Click here to Skip to main content
15,898,134 members
Home / Discussions / Java
   

Java

 
SuggestionRe: compiling my code Pin
Richard MacCutchan23-Feb-15 21:51
mveRichard MacCutchan23-Feb-15 21:51 
Questionadding multiply and division method Pin
Member 1147410123-Feb-15 14:29
Member 1147410123-Feb-15 14:29 
AnswerRe: adding multiply and division method Pin
Akash gods23-Feb-15 17:06
professionalAkash gods23-Feb-15 17:06 
GeneralRe: adding multiply and division method Pin
Member 1147410124-Feb-15 3:35
Member 1147410124-Feb-15 3:35 
AnswerRe: adding multiply and division method Pin
Richard MacCutchan23-Feb-15 21:50
mveRichard MacCutchan23-Feb-15 21:50 
GeneralRe: adding multiply and division method Pin
Member 1147410126-Feb-15 14:05
Member 1147410126-Feb-15 14:05 
GeneralRe: adding multiply and division method Pin
Richard MacCutchan26-Feb-15 21:09
mveRichard MacCutchan26-Feb-15 21:09 
AnswerRe: adding multiply and division method Pin
Akash gods27-Feb-15 9:44
professionalAkash gods27-Feb-15 9:44 
//solv by akshgods Smile | :)
/*
i deleted many thing which is not required in your program,
so always try to make simple and easy dear.
sorry for late reply
*/

package javaapplication8;

import java.util.*;

class MathOP{

//create a method mathadd
double mathadd(double a,double b){
return a+b;
}

// create a method mathsub
double mathsub(double x,double z){
return x-z;
}
}

//TestMathOp class

class TestMathOP {
public static void main (String args[])
{
MathOP mytest1 = new MathOP();
MathOP mytest2 = new MathOP();
double add;
double sub;

/*
scanner class for taking integer input
*/

Scanner sc=new Scanner(System.in);
int f=0;

while(f==0)//while for reapitation of program
{
add = mytest1.mathadd(5.5,7.5);
System.out.println("The sum of two number is " +add);

//get values of subtraction
sub = mytest2.mathsub(5.5,7.5);
System.out.println("The subtraction of two number is " +sub);

System.out.println("Do you want to exist (Y=1/N=0)?");

f=sc.nextInt();//here we are taking value from keybord 1 or 0 for exit or reapeat programm

if (f==1)
{

System.out.println("Thanks for using our system");
break;
}
else
{
System.out.println("run the program again");
}
}
}
}
SuggestionRe: adding multiply and division method Pin
Richard MacCutchan27-Feb-15 22:23
mveRichard MacCutchan27-Feb-15 22:23 
GeneralRe: adding multiply and division method Pin
Akash gods28-Feb-15 6:48
professionalAkash gods28-Feb-15 6:48 
GeneralRe: adding multiply and division method Pin
Richard MacCutchan28-Feb-15 6:55
mveRichard MacCutchan28-Feb-15 6:55 
QuestionWhat type of check is made in an ArrayList generic? Pin
Afzaal Ahmad Zeeshan22-Feb-15 7:06
professionalAfzaal Ahmad Zeeshan22-Feb-15 7:06 
AnswerRe: What type of check is made in an ArrayList generic? Pin
Richard MacCutchan22-Feb-15 7:38
mveRichard MacCutchan22-Feb-15 7:38 
GeneralRe: What type of check is made in an ArrayList generic? Pin
Afzaal Ahmad Zeeshan22-Feb-15 8:47
professionalAfzaal Ahmad Zeeshan22-Feb-15 8:47 
AnswerRe: What type of check is made in an ArrayList generic? Pin
jschell23-Feb-15 10:21
jschell23-Feb-15 10:21 
GeneralRe: What type of check is made in an ArrayList generic? Pin
Afzaal Ahmad Zeeshan23-Feb-15 20:26
professionalAfzaal Ahmad Zeeshan23-Feb-15 20:26 
GeneralRe: What type of check is made in an ArrayList generic? Pin
jschell26-Feb-15 9:50
jschell26-Feb-15 9:50 
Questionproject Pin
Member 1146518219-Feb-15 10:35
Member 1146518219-Feb-15 10:35 
AnswerRe: project Pin
Richard Andrew x6419-Feb-15 12:25
professionalRichard Andrew x6419-Feb-15 12:25 
AnswerRe: project Pin
Afzaal Ahmad Zeeshan22-Feb-15 6:55
professionalAfzaal Ahmad Zeeshan22-Feb-15 6:55 
Questionwhy calculation(BMI) is not working.... please help me... Pin
Member 1141203417-Feb-15 9:41
Member 1141203417-Feb-15 9:41 
GeneralRe: why calculation(BMI) is not working.... please help me... Pin
harold aptroot17-Feb-15 10:41
harold aptroot17-Feb-15 10:41 
Questionjava Pin
Member 1145378615-Feb-15 5:48
Member 1145378615-Feb-15 5:48 
AnswerRe: java Pin
Richard MacCutchan15-Feb-15 6:11
mveRichard MacCutchan15-Feb-15 6:11 
AnswerRe: java Pin
Richard Andrew x6419-Feb-15 12:26
professionalRichard Andrew x6419-Feb-15 12:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.