If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

need help with a project on C++. I am new and i am very confused.

Hi, i am in a C++ Programming class and i am taking it online and i am not learning anything at all. We are suppose to create a program for a grocery store system and i don't even know where to begin. I understand cout and cin and all that but we need to tell the customer how much apples are and how much oranges are. Then we need to ask them how many apples/oranges they would like. And that's where i am stuck at, i know how to ask them but i don't know how to times the amount of apples by the price and same thing with the oranges.

This is what my project is telling me to do.

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.

I'm not asking for anyone to write me the code, all i am asking is for some help on what do i need to type in the code so however many apples they want will be times by the price and same thing with the oranges.

I'm sorry if this is asking for too much but i can't really find any website that can help me.

Re: need help with a project on C++. I am new and i am very confused.

I'm not asking for someone to write me the code. I am asking for help with the multiplying part with the price of apples and how much they cost. I was just looking for help on what i would use, int or something else?

Re: need help with a project on C++. I am new and i am very confused.

We know... but as the link cilu posted suggests... we only help with actual coding problems... not design/how-to-start problems.

i am in a C++ Programming class and i am taking it online and i am not learning anything at all.

There is your problem... apparently your online course is crappy, but we aren't here to fix that.

Here is some info you will need for your project. if/else, for, arrays, double type variable (for using numbers behind the comma). Read the links and give it a try. As soon as you are stuck, post what you have and what your problem is, and we will be here to help you.

Re: need help with a project on C++. I am new and i am very confused.

Re: need help with a project on C++. I am new and i am very confused.

My advice will be to forget about the code all together for a minute, we always run into trouble when we believe programming is just reading a problem and writting long lines of code, it is an Art.
You should spend some time reading the problem and understanding exactly what is required from you, writte down some pseudo code on how you think you will achieve this requirements, work out the formulas to perform the operation needed, and from there you can start to write your code step by step, compiling at each step to ensure you dont carry bugs over... if you do this and still get stuck I am sure there will be many people here happy to help because at the moment there are no indications whatsoever that you even made an attempt...