lesson 2 done yay

This commit is contained in:
End Nightshade 2026-02-03 10:03:15 -07:00
parent 6dfe1096d8
commit 4356feb6db
No known key found for this signature in database
3 changed files with 52 additions and 0 deletions

View file

@ -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"
);
}
}

View file

@ -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("((') (')");
}
}

View file

@ -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"
);
}
}