I placed the sources of 2 calculators made by me in C++
with each iteration while, or preconditioned, the other will continue to do (hence the postconditioned) and for.
For simplicity the first one written is better, but for quality of the code, the second is more reliable. Even if it is still Spartan, I made in 10 minutes.
This is the second calculator
Code:
# include void main () (float difference, division, product, the sum, i, a, b, n, choice, cont; do (/ / parenthesis do court << "Choose an action to make \ n"; court << "1-Addition 2-Stealing 3-Multiplication 4-Division 5-Exit \ n"; cin>> choice; court << "\ nChoose the number of operandi"; cin>> n; if (choice == 1) ( for (cont = sum = 0; cont >; sum + = a;) court << "The sum and '" < >; difference-= a;) court << "The difference and '" < >; product *= a;) court << "The product and '" < >; court < > b; product *= b;) = a division / product; court << "The product and '" <
Bookmarks