Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Oscar Montgomery   on Jan 28 In Java Category.

  
Question Answered By: Rafael Thompson   on Jan 28

are you new to java?
just pass parameters in add  func to add numbers
bye
ur soln is:

import java.io.*;

class MathOp
{
public static  void main(String args[])throws
IOException
{
System.out.println(" MENU
");
System.out.println(" 1. ADD
");
System.out.println(" 2. SUBTRACT
");
System.out.println(" 3. MULTIPLY
");
System.out.println(" 4. DIVIDE
");
System.out.println("Enter your Choice");

BufferedReader Cin = new
BufferedReader(new
InputStreamReader(System.in));
String choice;
choice =Cin.readLine();
int ch =Integer.parseInt(choice);

switch(ch)
{
case 1:

System.out.println("Add");
add();
break;
case 2:
System.out.println
("Subtract");
break;
case 3:
System.out.println
("Multiply");
break;
case 4:

System.out.println("Divide");
break;
}

}

void add()
{
System.out.println{"Add");
}


}

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on where should i include function Or get search suggestion and latest updates.


Tagged: