Adding early CS challenge solutions

This commit is contained in:
2024-06-28 17:02:20 -04:00
parent 1c2266f4c5
commit 79772e0ee0
9 changed files with 343 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter your age: ");
int age = scan.nextInt();
scan.close();
if(age <= 18) {
System.out.println("You're a youngin'");
} else if(age > 18 && age <= 35) {
System.out.println("The early adult years");
} else if(age > 35 && age <= 55) {
System.out.println("Middle aged, time to buy a really expensive car");
} else if(age > 55 && age <= 64) {
System.out.println("Getting old...");
} else {
System.out.println("Retirement! Time to live out the golden years.");
}
}
}