diff --git a/U2/L1/U2_L1_Activity_One.java b/U2/L1/U2_L1_Activity_One.java new file mode 100644 index 0000000..22f2b5e --- /dev/null +++ b/U2/L1/U2_L1_Activity_One.java @@ -0,0 +1,24 @@ +/* Lesson 1 Coding Activity Question 1 */ + +import java.util.Scanner; + +public class U2_L1_Activity_One { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + System.out.println("What is your name?"); + String name = scanner.nextLine(); + + System.out.println("What is your favorite number?"); + int favoriteNumber = scanner.nextInt(); + + System.out.println( + "Your name is " + + name + + " and you like the number " + + favoriteNumber + + "." + ); + } +} diff --git a/U2/L1/U2_L1_Activity_Two.java b/U2/L1/U2_L1_Activity_Two.java new file mode 100644 index 0000000..73547f0 --- /dev/null +++ b/U2/L1/U2_L1_Activity_Two.java @@ -0,0 +1,20 @@ +/* Lesson 1 Coding Activity Question 2 */ + +import java.util.Scanner; + +public class U2_L1_Activity_Two { + + public static void main(String[] args) { + String order = "apple pie"; + + System.out.println("The current order is " + order); + + Scanner scanner = new Scanner(System.in); + System.out.println( + "I want to eat something else, what do you want to eat?" + ); + order = scanner.nextLine(); + + System.out.println("The order has changed to " + order); + } +}