mirror of
https://github.com/System-End/APCSA.git
synced 2026-04-19 16:38:24 +00:00
lesson 2 done yay
This commit is contained in:
parent
6dfe1096d8
commit
4356feb6db
3 changed files with 52 additions and 0 deletions
30
U2/L2/U2_L2_Activity_One.java
Normal file
30
U2/L2/U2_L2_Activity_One.java
Normal 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"
|
||||
);
|
||||
}
|
||||
}
|
||||
12
U2/L2/U2_L2_Activity_Three.java
Normal file
12
U2/L2/U2_L2_Activity_Three.java
Normal 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("((') (')");
|
||||
}
|
||||
}
|
||||
10
U2/L2/U2_L2_Activity_Two.java
Normal file
10
U2/L2/U2_L2_Activity_Two.java
Normal 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"
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue