'F' → Fullscreen
import java.util.Scanner;
public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in);
System.out.println("--- Demo 1 - Age Validator ---");
System.out.print("Enter your age: "); int userAge = input.nextInt();
input.nextLine(); // Consume newline
if (userAge >= 16) { System.out.println("Time to hit the road! You've earned your driving permit.\n"); }
if (userAge >= 18) { System.out.println("Adulting 101: You can now vote and live independently."); System.out.println("Please exit your mom's basement.\n"); }
if (userAge >= 35) { System.out.println("You're old enough to run for president.");
System.out.print("Enter your full name: "); String fullName = input.nextLine();
System.out.print("What year will you run? "); String electionYear = input.nextLine();
System.out.print("What's your nickname (e.g., 'The Awesome')? "); String nickName = input.nextLine();
System.out.println(nickName + " " + fullName + " for president in " + electionYear + "!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------// }}import java.util.Scanner;
public class Program { public static void main(String[] args) {36 collapsed lines
Scanner input = new Scanner(System.in);
System.out.println("--- Demo 1 - Age Validator ---");
System.out.print("Enter your age: "); int userAge = input.nextInt();
input.nextLine(); // Consume newline
if (userAge >= 16) { System.out.println("Time to hit the road! You've earned your driving permit.\n"); }
if (userAge >= 18) { System.out.println("Adulting 101: You can now vote and live independently."); System.out.println("Please exit your mom's basement.\n"); }
if (userAge >= 35) { System.out.println("You're old enough to run for president.");
System.out.print("Enter your full name: "); String fullName = input.nextLine();
System.out.print("What year will you run? "); String electionYear = input.nextLine();
System.out.print("What's your nickname (e.g., 'The Awesome')? "); String nickName = input.nextLine();
System.out.println(nickName + " " + fullName + " for president in " + electionYear + "!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------
System.out.println("\n--- Demo 2 - Simple Score Calculator ---");
System.out.print("Enter your score (0-100): "); int score = input.nextInt();
input.nextLine(); // Consume newline
if (score >= 60) { System.out.println("You passed!"); }
if (score < 60) { System.out.println("You did not pass. Keep studying!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------// }}import java.util.Scanner;
public class Program { public static void main(String[] args) {55 collapsed lines
Scanner input = new Scanner(System.in);
System.out.println("--- Demo 1 - Age Validator ---");
System.out.print("Enter your age: "); int userAge = input.nextInt();
input.nextLine(); // Consume newline
if (userAge >= 16) { System.out.println("Time to hit the road! You've earned your driving permit.\n"); }
if (userAge >= 18) { System.out.println("Adulting 101: You can now vote and live independently."); System.out.println("Please exit your mom's basement.\n"); }
if (userAge >= 35) { System.out.println("You're old enough to run for president.");
System.out.print("Enter your full name: "); String fullName = input.nextLine();
System.out.print("What year will you run? "); String electionYear = input.nextLine();
System.out.print("What's your nickname (e.g., 'The Awesome')? "); String nickName = input.nextLine();
System.out.println(nickName + " " + fullName + " for president in " + electionYear + "!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------
System.out.println("\n--- Demo 2 - Simple Score Calculator ---");
System.out.print("Enter your score (0-100): "); int score = input.nextInt();
input.nextLine(); // Consume newline
if (score >= 60) { System.out.println("You passed!"); }
if (score < 60) { System.out.println("You did not pass. Keep studying!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------
System.out.println("\n--- Demo 3 - Temperature Check ---");
System.out.print("What is the current temperature in Fahrenheit? "); int currentTemp = input.nextInt();
input.nextLine(); // Consume newline
if (currentTemp <= 32) { System.out.println("Brrr! It's freezing. Don't forget your coat!"); }
if (currentTemp > 32 && currentTemp <= 65) { System.out.println("It's a bit chilly. A light jacket should be perfect."); }
if (currentTemp > 65) { System.out.println("It's warm outside. Enjoy the nice weather!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------// }}import java.util.Scanner;
public class Program { public static void main(String[] args) {78 collapsed lines
Scanner input = new Scanner(System.in);
System.out.println("--- Demo 1 - Age Validator ---");
System.out.print("Enter your age: "); int userAge = input.nextInt();
input.nextLine(); // Consume newline
if (userAge >= 16) { System.out.println("Time to hit the road! You've earned your driving permit.\n"); }
if (userAge >= 18) { System.out.println("Adulting 101: You can now vote and live independently."); System.out.println("Please exit your mom's basement.\n"); }
if (userAge >= 35) { System.out.println("You're old enough to run for president.");
System.out.print("Enter your full name: "); String fullName = input.nextLine();
System.out.print("What year will you run? "); String electionYear = input.nextLine();
System.out.print("What's your nickname (e.g., 'The Awesome')? "); String nickName = input.nextLine();
System.out.println(nickName + " " + fullName + " for president in " + electionYear + "!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------
System.out.println("\n--- Demo 2 - Simple Score Calculator ---");
System.out.print("Enter your score (0-100): "); int score = input.nextInt();
input.nextLine(); // Consume newline
if (score >= 60) { System.out.println("You passed!"); }
if (score < 60) { System.out.println("You did not pass. Keep studying!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------
System.out.println("\n--- Demo 3 - Temperature Check ---");
System.out.print("What is the current temperature in Fahrenheit? "); int currentTemp = input.nextInt();
input.nextLine(); // Consume newline
if (currentTemp <= 32) { System.out.println("Brrr! It's freezing. Don't forget your coat!"); }
if (currentTemp > 32 && currentTemp <= 65) { System.out.println("It's a bit chilly. A light jacket should be perfect."); }
if (currentTemp > 65) { System.out.println("It's warm outside. Enjoy the nice weather!"); }
System.out.println("Press enter to continue..."); input.nextLine(); // -----------------------------------------------------------------------------
System.out.println("\n--- Demo 4 - Letter Grade Calculator ---");
System.out.print("Enter your final grade percentage (0-100): "); int finalGrade = input.nextInt();
if (finalGrade >= 90) { System.out.println("You got an A! Excellent work!"); }
if (finalGrade >= 80 && finalGrade < 90) { System.out.println("You got a B! Great job!"); }
if (finalGrade >= 70 && finalGrade < 80) { System.out.println("You got a C. Solid effort."); }
if (finalGrade >= 60 && finalGrade < 70) { System.out.println("You got a D. You passed, but there's room to improve."); }
if (finalGrade < 60) { System.out.println("You got an F. Let's review the material and try again."); }// }}Your program output should something similar to the sample output below.
--- Demo 1 - Age Validator ---Enter your age: 35Time to hit the road! You've earned your driving permit.
Adulting 101: You can now vote and live independently.Please exit your mom's basement.
You're old enough to run for president.Enter your full name: Anthony MortimerWhat year will you run? 2028What's your nickname (e.g., 'The Awesome')? SleepySleepy Anthony Mortimer for president in 2028!Press enter to continue...
--- Demo 2 - Simple Score Calculator ---Enter your score (0-100): 83You passed!Press enter to continue...
--- Demo 3 - Temperature Check ---What is the current temperature in Fahrenheit? 72It's warm outside. Enjoy the nice weather!Press enter to continue...
--- Demo 4 - Letter Grade Calculator ---Enter your final grade percentage (0-100): 76You got a C. Solid effort.You may write your reflection answers as comments at the bottom of your code.
Submit your activity and reflection answers to the appropriate dropbox.