Share your repls and programming experiences

← Back to all posts
Calculator
MananGandhi2 (11)

This is my passion project.

Comments
hotnewtop
gamingvideosD (0)

use a loop so u can do as much as you want but overall its good

like do soemthing like this
int num = 2;
int e =0;
while(true){
sout("type a num say (an int of your choice to quit)
num2 = input.nextInt();
num = num + num2;
if(num2 == (num of your choice){
break;
}

}
sout("sum: "+num);

i wrote it in java but you can rewrite in c++ just change the inputs and outputs
input.nextInt()
sout() change these

RhinoRunner (840)

wait is this for the WWD class?

FlaminHotValdez (442)

Maybe you could find a way so that it can add/multiply in the same go, like 1+2*3? Or maybe you could have the user just input the operation instead of choosing plus/minus/divide/multiply and input the numbers one by one.

daycore (0)

this is actually pretty good :)

zplusfour (891)

use try and catch to catch errors, because when I divide on zero it gives an error, yeah it should return an error but in the catch part I need you to print that division on zero is not allowed.

gjirtngisnt (14)

FINALLY A DECENT C++ PROJECT UPVOTE UPVOTE UPVOTE

henryeth (181)

Nicely done - clearly works very well - especially with the easy interface.