목록꿈 : 멋진 개발자 🧸/Java (28)
혜야의 코딩스토리

import java.util.Scanner; public class ArrayScore2D_Scan2 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("학생 수를 입력하세요 : "); int m = scan.nextInt(); //행의 개수 int n = 3; //열의 개수 int[][]score = new int[m][n]; System.out.println("국 영 수 점수를 각각 입력하세요 : "); for(int i=0; i

public class SalaryEx { //전역변수(멤버변수) 어디에서나 사용가능하며 값들이 기억되어진다. static String[] name = {"박과장","김과장","이대리","최주임","홍실장"}; static int[] salary = {3000, 3500, 4000, 4500, 5000}; //연봉 static int[] bonus = {0,0,0,0,0}; //보너스 static int[] total = new int[5]; //총액(연봉+보너스) static int[] tax = new int[5]; //세금 static int[] pay = new int[5]; //실수령액 static int pay_tot; //총 지급액 //계산용도 메소드 static void calc() { f..

public class StudentPoint { //멤버변수(전역변수) static int[] num = {1001,1002,1003}; static String[] name = {"홍길동","이몽룡","이순신"}; static int[] kor = {80,90,75}; static int[] eng = {70,90,100}; static int[] mat = {90,93,70}; static int[] tot = {0,0,0}; static double[] avg = {0,0,0}; static void getTot() { //총점 계산 메소드 for(int i=0; i
public class GuguEx { public static void main(String[] args) { System.out.println("==첫번째 gugu메소드 활용=="); gugu(2); System.out.println(); System.out.println("==두번째 guguAll메소드 활용=="); guguAll(); }//main public static int gugu(int n) { //한 개의 구구단 출력(n단) int result = 0; for(int i=1; i