This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Miniproject1 { | |
public static void main(String[] args) { | |
System.out.println("[구구단 출력]"); | |
for (int i = 1; i <= 9; i++) { | |
for (int j = 1; j <= 9; j++) { | |
System.out.print(String.format("%02d X %02d = %02d" + "\t", j, i, i * j)); | |
} | |
System.out.println(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Miniproject2 { | |
public static void main(String[] args) { | |
System.out.println("[캐시백 계산]"); | |
try (Scanner sc = new Scanner(System.in)) { // try-with-resources 문으로 Scanner 객체 자동 닫기 | |
System.out.print("결제 금액을 입력해 주세요. (금액):"); | |
int price = sc.nextInt(); | |
int cashback = price / 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Miniproject3 { | |
public static void main(String[] args) { | |
System.out.println("[입장권 계산]"); | |
try (Scanner sc = new Scanner(System.in)) { // try-with-resources 문으로 Scanner 객체 자동 닫기 | |
System.out.print("나이를 입력해 주세요.(숫자):"); | |
int age = sc.nextInt(); | |
System.out.print("입장시간을 입력해 주세요.(숫자입력):"); | |
int time = sc.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
import java.util.Scanner; | |
public class Miniproject4 { | |
public static void main(String[] args) { | |
System.out.println("[주민등록번호 계산]"); | |
try (Scanner sc = new Scanner(System.in)) { | |
System.out.print("출생년도를 입력해 주세요.(yyyy):"); | |
int year = sc.nextInt(); | |
if (year < 2020) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.LocalDate; | |
import java.util.Scanner; | |
public class Miniproject5 { | |
public static void main(String[] args) { | |
System.out.println("[달력 출력 프로그램]"); | |
try (Scanner sc = new Scanner(System.in)) { // try-with-resources 문으로 Scanner 객체 자동 닫기 | |
System.out.print("달력의 년도를 입력해 주세요.(yyyy):"); | |
int year = sc.nextInt(); | |
System.out.print("달력의 월을 입력해 주세요.(mm):"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
import java.util.Scanner; | |
public class Miniproject6 { | |
public static void main(String[] args) { | |
try(Scanner sc = new Scanner(System.in)) { | |
System.out.print("총 진행할 투표수를 입력해 주세요."); | |
int total = sc.nextInt(); | |
System.out.print("가상 선거를 진행할 후보자 인원을 입력해 주세요."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class Miniproject7 { | |
public static void main(String[] args) { | |
System.out.println("[로또 당첨 프로그램]\n"); | |
try (Scanner sc = new Scanner(System.in)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
김승일 | |
깜짝과제1 | |
*/ | |
import java.util.Scanner; | |
public class s_project1 { | |
public static void displayMenu() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Miniproject8 { | |
// Enum으로 상수 정의 | |
public enum IncomeLevel { | |
LEVEL_1(0, 12000000, 6, 0), | |
LEVEL_2(12000000, 46000000, 15, 1080000), | |
LEVEL_3(46000000, 88000000, 24, 5220000), | |
LEVEL_4(88000000, 150000000, 35, 14900000), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
김승일 | |
깜짝과제2 | |
*/ | |
package s_project; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; |
OlderNewer