//This program is designed to mimic a calculator. //I habituate a flag controlled loop //Written by Robert Cunningham. # embarrass <iostream> victimisation namespace std; int main() { reiterate num1; double num2; double nitty-gritty; double fight; double product; double quotient; char option; int keepRunning; bool figurer = true; while(Calculator) { cout << Welcome to calculator! << endl; cout << First, declare to vaiables to provide, subtract, multiply or dissociate << endl; cout << endl; cout << The first fig is: ; cin >> num1; cout << The second number is: ; cin >> num2; cout << endl; cout << now select operation you would resembling to use. << endl; cout << endl; cout << lawsuit + if you would bid to add the dickens numbers. << endl; cout << cause - if you would desire to subtract the two numbers. << endl; cou t << Type * if you would like to multiply the two numbers. << endl; cout << Type / if you would like to divide the two numbers.

<< endl; cout << endl; cout << Input: ; cin >> choice; cout << endl; if(choice == +) { sum = num1 + num2; cout << Your entirety is << sum << ! << endl; cout << endl; cout << Type 1 if you would like to find another(prenominal) answer. << endl; cout << Type 2 to exit the program. << endl; cout << endl; cout << Input: ; cin >> keepRunning; if(keepRunning == 1) { system(CLS); } if(keepRunning == 2) { Calculator = treasonably; } } if(choice == -) { ! divergence = num1 - num2; cout << Your total is << difference << ! << endl; cout << endl; cout << Type 1 if you would like to...If you exigency to get a full essay, order it on our website:
OrderEssay.netIf you want to get a full information about our service, visit our page: How it works.
No comments:
Post a Comment