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

ver 3

parent 2301fc44
......@@ -3,11 +3,11 @@ public class App {
14/02/2022 Valentine's Day
Elijah Vasquez */
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!"); // Ex 1
System.out.println("Hello, World!");
// Exercise 2 - Variables
int daysPerWeek = 7; // Ex 2.1
int numberOfWeeks = 6; // Ex 2.2
int totalDays = (daysPerWeek * numberOfWeeks); // Ex 2.3
System.out.println(totalDays);
......@@ -19,18 +19,35 @@ public class App {
double approxPI = 3.14; // Ex 2.5
System.out.println(approxPI * 2 * 3);
// Ex 2.6
String greetingString = "Hello"; // Ex 2.7
String introductionString = "My name is Inigo Montoya"; // Ex 2.8
String reminderString = "You killed my father"; // Ex 2.9
String threatString = "Prepare to die!"; // Ex 2.10
System.out.println(greetingString + ", " + introductionString + ", " +
reminderString + ", " + threatString);
reminderString + ", " + threatString);
int fingersOnRightHand = 6;
// Exercise 4 - Branching - if then else
int fingersOnRightHand = 5;
if (fingersOnRightHand == 6) {
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