aufgabe 9.4 b

class SchnipoStar5000{
 static int input;

 public static void main(String[] args){
	Out.println("Hungry?");
	Out.println("available commands are: 1 for 1euro , 2 for 2euro , 3 for Spar, 4 for Studi, 5 for Luxus, 6 for Payback, 7 for End ");
	euro0();
	Out.println("So long sucker!");
 }//main
 
 static void euro0(){
	Out.println("Input please");
	input = In.readInt();
	switch (input){
		case 1 : euro1(); break;
		case 2 : euro2(); break;
		case 3 : Out.println("Gimme money biatch"); euro0(); break;
		case 4 : Out.println("Gimme money biatch"); euro0(); break;
		case 5 : Out.println("Gimme money biatch"); euro0(); break;
		case 6 : Out.println("No money to give back"); euro0(); break;
		default      : break; // ha! not needed 
	}//switch
	
	if (input != 7){
	euro0();
	}
 }//euro0
 static void euro1(){
	Out.println("Input please");
	input = In.readInt();
	switch (input){
		case 1 : euro2(); break;
		case 2 : euro3(); break;
		case 3 : Out.println("Bon apetit (Spar)"); euro0(); break;
		case 4 : Out.println("Gimme money biatch"); euro1(); break;
		case 5 : Out.println("Gimme money biatch"); euro1(); break;
		case 6 : Out.println("1 euro for you"); euro0(); break;
		default      : break; // ha! not needed 
	}//switch
	
	if ( input != 7 ){
	euro1();
	}
 }//euro1
 static void euro2(){
	Out.println("Input please");
	input = In.readInt();
	switch (input){
		case 1 : euro3(); break;
		case 2 : euro4(); break;
		case 3 : Out.println("Bon apetit (Spar)"); euro1(); break;
		case 4 : Out.println("Bon apetit (Studi)"); euro0(); break;
		case 5 : Out.println("Gimme money biatch"); euro2(); break;
		case 6 : Out.println("2 euro for you"); euro0(); break;
		default      : break; // ha! not needed 
	}//switch
	
	if ( input != 7 ){
	euro2();
	}
 }//euro2
 static void euro3(){
	Out.println("Input please");
	input = In.readInt();
	switch (input){
		case 1 : euro4(); break;
		case 2 : Out.println("1 euro for you"); euro4(); break;
		case 3 : Out.println("Bon apetit (Spar)"); euro2(); break;
		case 4 : Out.println("Bon apetit (Studi)"); euro1(); break;
		case 5 : Out.println("Gimme money biatch"); euro3(); break;
		case 6 : Out.println("3 euro for you"); euro0(); break;
		default      : break; // ha! not needed 
	}//switch
	
	if ( input != 7 ){
	euro3();
	}
 }//euro3
 static void euro4(){
	Out.println("Input please");
	input = In.readInt();
	switch (input){
		case 1 : Out.println("1 euro for you"); euro4(); break;
		case 2 : Out.println("2 euro for you"); euro4(); break;
		case 3 : Out.println("Bon apetit (Spar)"); euro3(); break;
		case 4 : Out.println("Bon apetit (Studi)"); euro2(); break;
		case 5 : Out.println("Bon apetit (Luxus)"); euro0(); break;
		case 6 : Out.println("4 euro for you"); euro0(); break;
		default      : break; // ha! not needed 
	}//switch
	
	if ( input != 7 ){
	euro4();
	}
 }//euro0

}//class

Leave a Reply