SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 327 Weeks Ago, 5 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 18 May 2017 My Price 8.00

MathOP

import java.util.Scanner;

 

public 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 input = new Scanner(System.in);

int f = 0;

 

while(f == 0)//while for 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 = input.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");

}

}

}

}

 

import java.util.*;

public 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;
}
}

I need help, is not working right

Answers

(15)
Status NEW Posted 18 May 2017 03:05 AM My Price 8.00

-----------

Not Rated(0)