Commit 0da6d6cf authored by Danie's avatar Danie

First commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>groupProject</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=13
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=13
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=13
package groupProject;
import java.util.Scanner;
public class choiceSystem {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner keyboard = new Scanner(System.in);
int money = 8900;
String Go, Food, Leftovers, Eat; // a new string needs to be added for each new choice
System.out.println(" WELCOME TO STUDENT LIFE");
System.out.println(" ");
System.out.println(" This is the start of your university adventure, it's feshers week and you've just met your flatmates for the first time and they suggest going for a drink to get to know eachother, do you go for the 'drink' or stay home and 'unpack'? ");
System.out.print("> ");
Go = keyboard.next();
if (Go.equalsIgnoreCase("drink")) {
System.out.println("You're now drunk but happy you've made friends with your flatmates, -20. ");
money = money - 20;
System.out.println("" + money);
System.out.println("You're walking home and see a takeaway sign glowing in the night, do you go to the 'takeaway' or walk home and brave the 'leftovers' from the food you made earlier?");
System.out.print("> ");
Food = keyboard.next();
if (Food.equalsIgnoreCase("takeaway")) {
System.out.println("You enter the takeaway and have the choice between 'pizza' or a 'kebab', which do you choose?");
System.out.print("> ");
Eat = keyboard.next();
if (Eat.equalsIgnoreCase("pizza")) {
System.out.println(" ");
System.out.println("You feel full up and content in your drunk state, - 10."); //after these choices are made the game will progress to the next segment that can be seen as "next choice" at the bottom, this is where you copy, paste, edit and repeat the segment process
money = money - 10;
System.out.println("" + money);
} else if (Eat.equalsIgnoreCase("kebab")) {
System.out.println(" ");
System.out.println("You feel full up and content in your drunk state, - 5.");
money = money - 5;
System.out.println("" + money);
}
} else if (Food.equalsIgnoreCase("leftovers")) {
System.out.println("The leftovers in the fridge look edible even for your cooking, do you 'eat' the food or go to 'bed'?");
System.out.print("> ");
Leftovers = keyboard.next();
if (Leftovers.equalsIgnoreCase("eat")) {
System.out.println(" ");
System.out.println("You go to bed full, having spent nothing on takeaway but happy that you socialised");
} else if (Leftovers.equalsIgnoreCase("bed")) {
System.out.println(" ");
System.out.println("You go to bed hungry and looking forward to a big breakfast, having spent nothing on takeaway, but happy that you socilaised");
}
}
}
//I've added this below to edit and uncomment for the unpack scenario
// if (Go.equalsIgnoreCase("unpack")) {
// System.out.println(" ");
// money = money - 20;
// System.out.println("" + money);
// System.out.println("You're walking home and see a takeaway sign glowing in the night, do you go to the 'takeaway' or walk home and brave the 'leftovers' from the food you made earlier?");
// System.out.print("> ");
// Food = keyboard.next();
//
// if (Food.equalsIgnoreCase("takeaway")) {
// System.out.println("You enter the takeaway and have the choice between 'pizza' or a 'kebab', which do you choose?");
// System.out.print("> ");
// Eat = keyboard.next();
//
// if (Eat.equalsIgnoreCase("pizza")) {
// System.out.println(" ");
// System.out.println("You feel full up and content in your drunk state, - 10.");
// money = money - 10;
// System.out.println("" + money);
// } else if (Eat.equalsIgnoreCase("kebab")) {
// System.out.println(" ");
// System.out.println("You feel full up and content in your drunk state, - 5.");
// money = money - 5;
// System.out.println("" + money);
// }
// } else if (Food.equalsIgnoreCase("leftovers")) {
// System.out.println("The leftovers in the fridge look edible even for your cooking, do you 'eat' the food or go to 'bed'?");
// System.out.print("> ");
// Leftovers = keyboard.next();
//
// if (Leftovers.equalsIgnoreCase("eat")) {
// System.out.println(" ");
// System.out.println("You go to bed full, having spent nothing on takeaway but happy that you socialised");
// } else if (Leftovers.equalsIgnoreCase("bed")) {
// System.out.println(" ");
// System.out.println("You go to bed hungry and looking forward to a big breakfast, having spent nothing on takeaway, but happy that you socilaised");
// }
// }
// }
System.out.println("Next choice");
}
}
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