I\'ve had to make 3 different classes that I will have to call to my main method
ID: 3532297 • Letter: I
Question
I've had to make 3 different classes that I will have to call to my main method. I have no idea how to call classes to my main method. Any help is appreciated. Thanks. I have uploaded what the different classes are suppose to do and how the main method is organized. I'm pretty sure the 3 classes are close to perfect (I had my teacher look over them), so now I just have to make the main method. I just have no idea how to class the different methods in my classes.
overview of classes
Flow chart of main method
Explanation / Answer
public static void main(String args[])
{
while(1)
{
Scanner s= new Scanner(System.in);
System.out.printtln("Welcome");
System.out.printtln("Enter the no of digits");
Engine E=new Engine();
E.numDigits=s.nextInt();
E.secretNumber=5;
System.out.printtln("Enter the player name");
Player p=new Player();
p.name=s.next();
System.out.printtln("Starting game");
System.out.printtln("Enter the guess");
int guess=s.nextInt();
while(guess!=E.secretnumber)
{
System.out.printtln("Sorry wrong guess,plz try again");
System.out.printtln("Emter the guess");
if(write)
{
System.out.printtln("Congrates");
break;
}
}
int guess=s.nextInt();
if(guess!=E.secretnumber)
{
System.out.printtln("Congrates");
break;
}
else
{
while(guess!=E.secretnumber)
{
System.out.printtln("Sorry wrong guess,plz try again");
System.out.printtln("Emter the guess");
int guess=s.nextInt();
if(guess!=E.secretnumber)
{
System.out.printtln("Congrates");
break;
}
}
}
System.out.printtln("Menu");
System.out.printtln("Enter p for starting new game");
System.out.printtln("Enter r for entering new digit");
System.out.printtln("Enter q for quit");
String m=s.next();
if(m=="p")
{
System.out.printtln("Starting game");
System.out.printtln("Enter the guess");
else if(m=="r")
{
continue;
}
else if(m=="q")
{
System.exit(5);
}
}
}
This is a prototype, I can write whole assignment for you also.Plz mail me mukesh.6182@gmail.com
And rate me 5 stars also
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.