ok so ive been working on this project for about 3 days now and i still have a few problems. 1. capitals don't work. 2. i have no idea how to make remainder work because it wont work with double. 3. i need to display a message, if the choice is none of what i have in my code that simply says that their choice is invalid. code is as follows. 4. if the user types in more than just the first letter the program crashes. i dont know how to allow the user to type more than just the firsrt letter without the program crashing.
Code:#include <iostream> using namespace std; double main () { double a,b; char choice ; while (true){ cout << "\nGive me a number: "; cin >> a; cout << "Give me another number: "; cin >> b; cout << "What do you want to do? "; cin >> choice; if (choice == 'm') cout << a << " * " << b << " = " << a*b; if (choice == 'd') { if (b == 0) cout << "Cannot divide by zero. Start over and choose another number."; else cout << a << " / " << b << " = " << a/b; } if (choice == 's') cout << a << " - " << b << " = " << a-b; if (choice == 'a') cout << a << " + " << b << " = " << a+b; } cin.ignore(); cin.ignore(); return 0; }