So been trying to finish this assignment for weeks now and i only have a couple weeks left before i fail it. everything needs to be done locally. if anyone could help me do the menu? heres what its asking me to do
The standalone Console Application will:
• Provide an intuitive and easily navigable text based menu-driven interface allowing the user to navigate back and forth between options
The options to be provided are:
Option 1: To generate a personal username
Option 2: To calculate a number’s factorial
Option 3: To exit from the application
• The user is required to supply an appropriate numeric menu option at a QWERTY keyboard
• The user’s input will be checked and only the numbers 1 or 2 or 3 will be accepted as valid
• The following error message will be displayed if an invalid entry is given
“You entered an invalid menu choice, only the numbers ‘1’, ’2’ and
‘3’ are allowed, please press return and try again”
• When a valid menu option is provided, the user will be able to perform the associated task and will be prompted to return to the above menu when finished
• The program will continue to perform in this way until the user decides to terminate by entering the number 3
Menu Option 1 will:
• Offer the user the opportunity to generate a personal username based on the forename and surname provided
• NOT be required to perform any check of the validity of the user inputs
• Create a space-free username from the names provided by joining the surname to the initial (the first character of the forename)
e.g.
for a forename John and surname Craig entered, a username JCraig will be created
The Functional Requirements (continued)
Menu Option 2 will:
• Offer the user the opportunity to display the factorial of a whole number
“In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n”
e.g.
The factorial of 5 (represented mathematically as 5!) is calculated by multiplying 5 by 4 then by 3, then by 2 and finally by 1
5! = 5*4*3*2*1
= 120
Therefore
6! =6*5!
= 720
etc.
• NOT be required to perform any check of the validity of the input supplied
Menu Option 3 will:
• Offer the user the opportunity to quit the application whereby control will return back to the operating system
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#include <iostream>
using namespace std;
void createusernamespec();
void displayfactorialspec();
void evalfactorialspec();
void getnames();
void getnumberspec();
void showusernamespec();
void menuspec();
void menuspec()
{
cout << "Welcome to the EPOS Options Ltd.\n";
cout << "Network Administration& Statistics Department’s\n";
cout << "Pilot One Stop Shop interface\n\n\n";
cout << "1 \t Create a username\n";
cout << "2 \t Factorial a number\n";
cout << "3 \t Exit\n";
char usersChoice;
do
{
menuspec();
cout << "Please enter your choice:\n";
cin >> usersChoice;
switch (usersChoice)
{
case '1':
cout << "Please enter your full name\n";
system("pause");
break;
case '2':
cout << "Enter a number to factorial\n";
system("pause");
break;
case '3':
cout << "This program will now quit\n";
break;
default:
cout << "That was an invalid choice, please try again\n";
break;
}
} while (usersChoice != '3' && usersChoice != '3');
}
void getnames()
{
}
void getnumberspec()
{
}
void createusernamespec()
{
}
void showusernamespec()
{
}
void evalfactorialspec()
{
}
void displayfactorialspec()
{
}
int main()
{
menuspec();
system("pause");
return 0;
}
|