Please Help. This should be simple....

I need someone to come up with a short simple programe to do the following, I have the main class and thread I just need the main working body(i am very new!). It needs to calculate the following:

50+70=120
120/4=30 /2=15

70/4 =17.5

80/2 = 40

then 15+17.5+40 = 72.5

Please help I'm sure someone here has the brains to do that. Happy New Year.

Comments

  • public class mathmathics {

    public static void main(String[] args) {
    int a = 50+70;
    int b = 120/4/2
    double c = 70/4;
    int d = 80/2;
    int e = b+c+d;
    system.out.println(b + "+" + c + "+" + d + " = " + e);
    }

    you can add sysouts, to all the calculations like i did in the example at the bottom.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion