THOUSANDS OF FREE BLOGGER TEMPLATES

Linggo, Enero 15, 2012

import java.util.Scanner;

public class answer
{
public static void main(String[] args)
{

String ans;
int subject;

Scanner number = new Scanner (System.in);
System.out.println("SELECT FROM THE SUBJECT BELOW:  ");
System.out.println("\n========================= ");
System.out.println("   [1] - MATH");
System.out.println("   [2]- FILIPINO");
System.out.println("   [3] - SCIENCE");
System.out.println("   [4] - PROGRAMMING");
System.out.println("========================= ");
System.out.println("\n\n\nENTER YOUR SELECT SELECTION:  ");
subject = number.nextInt();


if(subject == 1)
    {
        System.out.println("\n[1] - MATH");
        System.out.println("YOU CHOOSE MATH");
        System.out.println("WHAT IS THE SUM OF 10 * 5");
        System.out.println("ENTER ANSWER HERE:");
        ans = number.next();
        if(ans.equals("50"))
            {
            System.out.println("your correct!!!");
            }
            else
            {
            System.out.println("your are wrong!!!");
            }
        }

else if(subject == 2)
    {
        System.out.println("\n[1] - FILIPINO");
        System.out.println("YOU CHOOSE FILIPINO");
        System.out.println("The reason why was jose rizal shot to death?");
        System.out.println("ENTER ANSWER HERE:");
        ans = number.next();
        if(ans.equals("cardiac arrest..."))
            {
            System.out.println("your correct!!!");
            }
            else
            {
            System.out.println("your are wrong!!!");
            }
        }

else if(subject == 3)
    {
        System.out.println("\n[1] - SCIENCE");
        System.out.println("YOU CHOOSE SCIENCE");
        System.out.println("THE STUDY OF LIFE.");
        System.out.println("ENTER ANSWER HERE:");
        ans = number.next();
        if(ans.equals("biology"))
            {
            System.out.println("your correct!!!");
            }
            else
            {
            System.out.println("your are wrong!!!");
            }
        }
else if(subject == 4)
    {
        System.out.println("\n[1] - PROGRAMMING");
        System.out.println("YOU CHOOSE PROGRAMMING");
        System.out.println("collection of information that is organized so that it can easily be accessed, managed, and updated..");
        System.out.println("ENTER ANSWER HERE:");
        ans = number.next();
        if(ans.equals("Database"))
            {
            System.out.println("your correct!!!");
            }
            else
            {
            System.out.println("your are wrong!!!");
            }
        }

else
    {
        System.out.println("\nINVALID ENTRY");

    }
}
}

0 (mga) komento: