Initial Commit

This commit is contained in:
2022-10-07 00:22:46 -03:00
commit bdcf6d3e1c
465 changed files with 15466 additions and 0 deletions

8
Source Code/Assignment5Q1/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../../:\JavaProjects\JavaYear1\Assignment5Q1\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@@ -0,0 +1,25 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
</code_scheme>
</component>

View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@@ -0,0 +1 @@
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Assignment5Q1.iml" filepath="$PROJECT_DIR$/Assignment5Q1.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,3 @@
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,68 @@
/**
* @author Isaac Shoebottom (3429069)
*/
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
boolean gotPaid;
boolean boughtGroceries;
boolean leftoversAtHome;
boolean enoughLeftoversForMeal;
String scannerIn;
System.out.println("Did you get paid this week?");
scannerIn = scanner.nextLine();
scannerIn = scannerIn.toLowerCase();
scannerIn = (scannerIn.equals("yes")) ? "true" : (scannerIn.equals("no")) ? "false" : "not yes or no";
gotPaid = Boolean.parseBoolean(scannerIn);
if (gotPaid) {
System.out.println("Did you buy groceries this week?");
scannerIn = scanner.nextLine();
scannerIn = scannerIn.toLowerCase();
scannerIn = (scannerIn.equals("yes")) ? "true" : (scannerIn.equals("no")) ? "no" : "not yes or no";
boughtGroceries = Boolean.parseBoolean(scannerIn);
if (!boughtGroceries) {
System.out.println("Do you have leftovers at home?");
scannerIn = scanner.nextLine();
scannerIn = scannerIn.toLowerCase();
scannerIn = (scannerIn.equals("yes")) ? "true" : (scannerIn.equals("no")) ? "no" : "not yes or no";
leftoversAtHome = Boolean.parseBoolean(scannerIn);
if (leftoversAtHome) {
System.out.println("Are there enough leftovers for a meal?");
scannerIn = scanner.nextLine();
scannerIn = scannerIn.toLowerCase();
scannerIn = (scannerIn.equals("yes")) ? "true" : (scannerIn.equals("no")) ? "no" : "not yes or no";
enoughLeftoversForMeal = Boolean.parseBoolean(scannerIn);
if (!enoughLeftoversForMeal) {
System.out.println("You should eat at a restaurant.");
}
else {
System.out.println("You should eat at home.");
}
}
else {
System.out.println("You should eat at a restaurant.");
}
}
else {
System.out.println("You should eat at home.");
}
}
else {
System.out.println("You should eat at home.");
}
}
}