Created
September 15, 2021 18:34
-
-
Save samuelteixeiras/49bf6226cdb1e857426b816d09c80df4 to your computer and use it in GitHub Desktop.
WeekOneExercises java class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package weekOne; | |
import java.util.Scanner; | |
public class WeekOneExercises { | |
static Scanner scanner; | |
public final static void main(String args[]) { | |
Boolean didOswaldActAlone = didOswaldActAlone(true); | |
if (didOswaldActAlone) { | |
System.out.println("Oswald acted alone"); | |
} else { | |
System.out.println("Oswald did not acted alone"); | |
} | |
String favouriteFilmReturned = favouriteFilm("matrix"); | |
System.out.println("Move rating is: " + filmRating(favouriteFilmReturned)); | |
} | |
public static boolean didOswaldActAlone(boolean response) { | |
return response; | |
} | |
public boolean wasOjGuilty(boolean response) { | |
return response; | |
} | |
public static String favouriteFilm(String movie) { | |
return movie; | |
} | |
public static String filmRating(String movie) { | |
scanner = new Scanner(System.in); | |
System.out.println("Please enter the rating for movie : " + movie); | |
String movieRate = scanner.nextLine(); | |
return movieRate; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment