Design a calculator that performs four operations: addition, multiplication, div
ID: 3678767 • Letter: D
Question
Design a calculator that performs four operations: addition, multiplication, division and subtraction with 2 integer type numbers.
a) Ask user what type of operation to perform (+, -, * or /) a. If the user inputs ‘none’ then the program terminates. Otherwise it will keep continuing the calculation. (hint: use while) b) Ask user to provide 2 integer number inputs
c) Perform operation (whatever operation they mentioned in a)
d) Print result
e) In division operation, perform a check if the denominator is a 0. If it is 0, then print a message that – denominator cannot be 0 while performing a division operation
Explanation / Answer
# include using namespace std; int main() { char o; int num1,num2; cout > o; cout > num1 >> num2; switch(o) { case '+': coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.