I need a menu driven program that has the following 5 choices.
Output a sum of even numbers
Output a table of odd numbers
Output their square root
Output all lower case and upper case letter
Quit.
I have the code to all the functions now I just need to put it into a menu driven. Which I have tried using a switch statement but have fail every time.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int firstNum, secondNum;
int sumEvenNum = 0;
int sumSquareOddNum = 0;
char chCounter;
int counter;
//Part a
cout << "Enter two numbers." << endl;
cout << "First number must be less than ";
cout << "the second number you enter" << endl;
cout << "Enter numbers: " << flush;
cin >> firstNum >> secondNum;
cout << endl;
//Part b
if (firstNum % 2 == 0)
counter = firstNum;
else
counter = firstNum + 1;
Here is the program that's menu driven. You should have inputs for options 2 and 3, also. Do not depend on a user entering option 1 after starting the program. Also use code tags. The symbol is <> under Format: to the right.
This code didnt compile and gave the error
>c:\users\public\documents\c++\homework7\homework7\the increadible looping machine.cpp(9): fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
1>