Commit 2301fc44 authored by elijah vasquez's avatar elijah vasquez 🦍

Replace App.java

parent a93e9f62
public class App { public class App {
/* Exercises for Week 2 Programming 2 /* Exercises for Week 2 Programming 2
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!"); // Ex 1
int daysPerWeek = 7; // Ex 2.1 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);
boolean onHoliday = false; // Ex 2.4 boolean onHoliday = false; // Ex 2.4
if (onHoliday == false) { if (onHoliday == false) {
System.out.println("You are not on holiday."); System.out.println("You are not on holiday.");
}
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);
int fingersOnRightHand = 6;
if (fingersOnRightHand == 6) {
System.out.println(fingersOnRightHand);
}
} }
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);
int fingersOnRightHand = 5;
} }
}
\ 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