diff --git a/U2/L2/U2_L2_Activity_One.java b/U2/L2/U2_L2_Activity_One.java new file mode 100644 index 0000000..9c71b59 --- /dev/null +++ b/U2/L2/U2_L2_Activity_One.java @@ -0,0 +1,30 @@ +/* Lesson 2 Coding Activity Question 1 */ + +import java.util.Scanner; + +public class U2_L2_Activity_One { + + public static void main(String[] args) { + Scanner scan = new Scanner(System.in); + + System.out.println("What type of item are you buying?"); + String itemType = scan.nextLine(); + + System.out.println("How many are you buying?"); + int numberOfItems = scan.nextInt(); + + System.out.println("How much does each one weigh?"); + double weightPerItem = scan.nextDouble(); + + System.out.println( + numberOfItems + + " " + + itemType + + " at " + + weightPerItem + + " pounds each will weigh " + + (numberOfItems * weightPerItem) + + " pounds total" + ); + } +} diff --git a/U2/L2/U2_L2_Activity_Three.java b/U2/L2/U2_L2_Activity_Three.java new file mode 100644 index 0000000..7885574 --- /dev/null +++ b/U2/L2/U2_L2_Activity_Three.java @@ -0,0 +1,12 @@ +/* Lesson 2 Coding Activity Question 3 */ + +import java.util.Scanner; + +public class U2_L2_Activity_Three { + + public static void main(String[] args) { + System.out.println("(\\(\\"); + System.out.println("( - -)"); + System.out.println("((') (')"); + } +} diff --git a/U2/L2/U2_L2_Activity_Two.java b/U2/L2/U2_L2_Activity_Two.java new file mode 100644 index 0000000..1e27b5c --- /dev/null +++ b/U2/L2/U2_L2_Activity_Two.java @@ -0,0 +1,10 @@ +/* Lesson 2 Coding Activity Question 2 */ + +public class U2_L2_Activity_Two { + + public static void main(String[] args) { + System.out.println( + "\"That brain of mine is something more than merely mortal; as time will show.\"\nAda Lovelace\nThe first computer programmer" + ); + } +}