|
I created a Java Program for my final exam but i dont know -
December 14th, 2007
how to reset it? Code is in the details section.? import java.awt.*;
import hsa.Console;
public class Finalproject
{
static Console a;
static Console b;
static Console c;
// The output console
public static void main (String[] args)
{
a = new Console ();
{
int pass;
a.println("PLease type in ur password");
pass = a.readInt ();
if (pass == 414)
{
a.print ("password is correct");
}
else if (pass != 414)
{
a.print ("ERROR:WORNG PASSWORD");
}
b = new Console();
b.print ("How To Play Soccer Triva");
b.println("\n\n The controls of this game is really simple. if u have a question lets say that for example :\n\n\t\t which team won the first world cup?\n\n a) brazil\t\t b) Germany.\n\n all u have to do is rype in the letter ");
b.println("Please type down any key to continue");
String playgame= b.readLine();
}
c = new Console();
c.setTextColor(Color.blue);
c.println ("Play Game & Game");
c.setTextColor(Color.black);
c.println ("Where was the first world cup game played in?");
c.println("\n 1)Germany, 2)Brazil, 3)Italy, 4)Urguary");
{
int answer;
c.println("Please type in your answer");
answer=c.readInt();
if (answer==1)
{
c.setTextColor(Color.green);
c.print(" Correct answer");
}
else if (answer !=1)
{
c.setTextColor(Color.red);
c.println("Wrong answer the correct answer is number 4");
}
}
|