Hey guys. I am taking a C++ programming course and I don't know what to do. I am using MS Visual C++ Express edition 2005 as required by the course. Here are the project instructions:
Graded Project 1: Grocery Store
For this project, create a grocery store system. Users of the system can choose how many items
they want to buy and then are told how much they owe. Users will have the option of buying
apples and oranges. Here are some parameters that your program should include:
· Program should ask users how many apples and oranges they want to buy.
· Apples cost $1.00 and Oranges cost $1.50.
· Today’s Special! Apples are 2 for 1. Buy one get one free! (1 apple = $1.00, 2 apples =
$1.00, 3 apples = $2.00, 4 apples = $2.00, etc.)
· Another Special! How ever many oranges you buy will give you the same number of
percentage off your total bill. (If you buy 10 oranges you get 10% off your total bill. ) (For
now, ask the user to enter a number between 1 and 100. If they don’t the numbers will
not make sense. Later we will learn how to capture user input errors.
· If you have bought 2 apples = $1.00 and 10 oranges = $15.00 your total bill would be
$16.00. But you get 10% off! (use percentage/100*amount = discount amount) 10% of
$16.00 = (10/100) * 16.00 = $1.60 discount. Total bill = $16.00 - $1.60 = $14.40
· Your program should tell the user how much they owe.
Other things to keep in mind:
· Use one function to calculate the price of the apples and another function to calculate the
price of the oranges.
· If you have programmed before, do not use the If statement. You should be able to
program this project without using the If statement (We’ll learn about the If statement in
the next workshop)
When you are finished:
· Submit the .cpp source file, .exe file and code file to your instructor in a zipped folder.
· Put your name in a comment at the top of the file, followed by the name of the program.
Evaluation Criteria
Your project will be evaluated using the following criteria:
1. The program compiles/builds successfully, runs normally (no runtime errors or
unnecessary delays), and exits normally.
2. The program asks how many apples you want and receives keyboard input.
3. The program asks how many oranges you want. It explains that a number between 1
and 100 is required. It receives keyboard input.
4. The program outputs the correct amount of money.
5. The program uses one function to calculate the price of the apples and another function
to calculate the price of the oranges.
6. The program does not use the If statement.
7. The program is easy to use.
8. The program does not perform unnecessary tasks.
9. The source code is contained in one file and is not unnecessarily long.
10. The source code utilizes white space properly and consistently to enhance legibility.
11. The variable/function names are chosen and typed/written in a way that clearly explains
their purposes. The naming style is consistent throughout the whole program.
12. The source contains effective, consistent comments, especially near any complex or
obscure sections of code.
I am using static variables. I need help with the Apple function. How do I set it up as in I can't do : static float applecost/=2. Because if the person buys 3 apples, 3/2 does not equal 2 as it should. How do I do it?
Side note: Is there anyway that I can upload what I've done in the program so far?
Graded Project 1: Grocery Store
For this project, create a grocery store system. Users of the system can choose how many items
they want to buy and then are told how much they owe. Users will have the option of buying
apples and oranges. Here are some parameters that your program should include:
· Program should ask users how many apples and oranges they want to buy.
· Apples cost $1.00 and Oranges cost $1.50.
· Today’s Special! Apples are 2 for 1. Buy one get one free! (1 apple = $1.00, 2 apples =
$1.00, 3 apples = $2.00, 4 apples = $2.00, etc.)
· Another Special! How ever many oranges you buy will give you the same number of
percentage off your total bill. (If you buy 10 oranges you get 10% off your total bill. ) (For
now, ask the user to enter a number between 1 and 100. If they don’t the numbers will
not make sense. Later we will learn how to capture user input errors.
· If you have bought 2 apples = $1.00 and 10 oranges = $15.00 your total bill would be
$16.00. But you get 10% off! (use percentage/100*amount = discount amount) 10% of
$16.00 = (10/100) * 16.00 = $1.60 discount. Total bill = $16.00 - $1.60 = $14.40
· Your program should tell the user how much they owe.
Other things to keep in mind:
· Use one function to calculate the price of the apples and another function to calculate the
price of the oranges.
· If you have programmed before, do not use the If statement. You should be able to
program this project without using the If statement (We’ll learn about the If statement in
the next workshop)
When you are finished:
· Submit the .cpp source file, .exe file and code file to your instructor in a zipped folder.
· Put your name in a comment at the top of the file, followed by the name of the program.
Evaluation Criteria
Your project will be evaluated using the following criteria:
1. The program compiles/builds successfully, runs normally (no runtime errors or
unnecessary delays), and exits normally.
2. The program asks how many apples you want and receives keyboard input.
3. The program asks how many oranges you want. It explains that a number between 1
and 100 is required. It receives keyboard input.
4. The program outputs the correct amount of money.
5. The program uses one function to calculate the price of the apples and another function
to calculate the price of the oranges.
6. The program does not use the If statement.
7. The program is easy to use.
8. The program does not perform unnecessary tasks.
9. The source code is contained in one file and is not unnecessarily long.
10. The source code utilizes white space properly and consistently to enhance legibility.
11. The variable/function names are chosen and typed/written in a way that clearly explains
their purposes. The naming style is consistent throughout the whole program.
12. The source contains effective, consistent comments, especially near any complex or
obscure sections of code.
I am using static variables. I need help with the Apple function. How do I set it up as in I can't do : static float applecost/=2. Because if the person buys 3 apples, 3/2 does not equal 2 as it should. How do I do it?
Side note: Is there anyway that I can upload what I've done in the program so far?
Comment