need help with a project on C++. I am new and i am very confused.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

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

  1. #1
    Join Date
    Jun 2009
    Posts
    1

    Exclamation 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.

    Any help is appreciated.

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

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

    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Jun 2009
    Posts
    1

    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?

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    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.
    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.

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,891

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

    The * symbol is used for multiplication.

  6. #6
    Join Date
    Oct 2006
    Posts
    15

    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...
    ...Don't be afraid, only believe.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center