Commit 4d7c5ee8 authored by elijah vasquez's avatar elijah vasquez 🦍

ver 3

parent 2301fc44
...@@ -3,11 +3,11 @@ public class App { ...@@ -3,11 +3,11 @@ public class App {
14/02/2022 Valentine's Day 14/02/2022 Valentine's Day
Elijah Vasquez */ Elijah Vasquez */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
System.out.println("Hello, World!"); // Ex 1 System.out.println("Hello, World!");
int daysPerWeek = 7; // Ex 2.1
// Exercise 2 - Variables
int daysPerWeek = 7; // Ex 2.1
int numberOfWeeks = 6; // Ex 2.2 int numberOfWeeks = 6; // Ex 2.2
int totalDays = (daysPerWeek * numberOfWeeks); // Ex 2.3 int totalDays = (daysPerWeek * numberOfWeeks); // Ex 2.3
System.out.println(totalDays); System.out.println(totalDays);
...@@ -19,7 +19,6 @@ public class App { ...@@ -19,7 +19,6 @@ public class App {
double approxPI = 3.14; // Ex 2.5 double approxPI = 3.14; // Ex 2.5
System.out.println(approxPI * 2 * 3); System.out.println(approxPI * 2 * 3);
// Ex 2.6
String greetingString = "Hello"; // Ex 2.7 String greetingString = "Hello"; // Ex 2.7
String introductionString = "My name is Inigo Montoya"; // Ex 2.8 String introductionString = "My name is Inigo Montoya"; // Ex 2.8
String reminderString = "You killed my father"; // Ex 2.9 String reminderString = "You killed my father"; // Ex 2.9
...@@ -27,10 +26,28 @@ public class App { ...@@ -27,10 +26,28 @@ public class App {
System.out.println(greetingString + ", " + introductionString + ", " + System.out.println(greetingString + ", " + introductionString + ", " +
reminderString + ", " + threatString); reminderString + ", " + threatString);
int fingersOnRightHand = 6; // Exercise 4 - Branching - if then else
int fingersOnRightHand = 5;
if (fingersOnRightHand == 6) { if (fingersOnRightHand == 6) {
System.out.println(fingersOnRightHand); System.out.println(fingersOnRightHand);
} }
else {
System.out.println("I am searching for the man who killed my father.");
}
// Exercise 5 - Branching - switch
int month = 1;
// Exercise 6 - Looping - for loop
// Exercise 7 - Looping - while(), do{} while()
// Exercise 8 - Methods
// Exercise 9 - isItALeapYear()
// Exercise 10 - daysBetween()
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment