need help coding

1. Write a function call displayMenu without parameters which will display a menu
2. write a function called getChoice that has no parameters. It will ask the user’s choice and validate it
(only accept 1,2,3,4,and 5). The function will return the valid choice.
3. write a function called showTotal which will use the number of bouquets and the unit price passed to
it as arguments to compute and show the total price of the purchase.
4 Write the main function as follows:
a) define the unit prices of different types as constants.
d) call function displayMenu to display the menu.
c) call getChoice function to get a valid choice
d ) if the choice got in c) is not 5, ask the user how many bouquets they want to buy, use switch
statements to determine the unit price and show the total price by call function showTotal.
e) If choice is not 4, do a) to d) again.

ITEM UNIT PRICE
1 $ 5.25
2 $ 3.10
3 $ 9.75
4 $ 6.50
5 quit
what do you have so far?

are you sure part E doesn't have a typo?

e) If choice is not 5, do a) to d) again -- i feel like that's the idea
Yes that is a typo. You are right on what is it supposed to be.
all I have is this so far because I forgot how to do any other type of function besides void.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;
void displayMenu();
int getChoice;
void showTotal;
int main()
{
 displayMenu();
system("pause");
	return 0;
}
void displayMenu()
{
	cout << "Item " << "Unit Price\n";
		cout << "1 " << "   $5.25\n";
	cout << "2 " << "   $3.10\n";
	cout << "3 " << "   $9.75\n";
	cout << "4 " << "   $6.50\n";
}
int getChoice()
{
	cout << ""
	
}
For getChoice() you want to:
- prompt the user for their answer
- read the answer
- If it's a legal choice then return it.
- otherwise print an error message and loop back to the beginning.
Topic archived. No new replies allowed.