Thread: c++ code help

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    1

    Question c++ code help

    Hello i am writing a program and i really need help. here is what the program is about.
    1. It needs to ask a number of tickets sold.
    2. persantage which goes to some other coast. This input will be entered in percent format. program must convert this to a decimal fraction, like 20% should be .20 and so on.
    3. Total amount of prize money distributed.
    4. Name of the avent.

    The out put should be somthing like this.

    1. Name of charity
    2. Total revenue generated from the ticket sales. The price of each ticket is currently fixed at $5.00.
    3. Total amount of administrative overhead.
    4. Total amount of prize money overhead.
    5. Balance remaining for the charitable fund.
    the output format...
    How many tickets were sold? 50000
    What percentage of the ticket revenue goes to administrative costs? 2
    How much total money is distributed in prizes? 15000
    What is the name of the charity? Good Intentions

    Charity: "Good Intentions"
    Revenue generated from ticket sales: $ 250000.00
    Amount deducted for administrative overhead: $ 5000.00
    Amount deducted for prize money: $ 15000.00
    Balance raised for charitable fund: $ 230000.00

    My code is below:

    #include <iostream>
    #include <string>
    using namespace std;

    int main ()

    {
    const int price=5;
    string name;
    int total_money, total_price;tickets, percentage;
    cout<<"Enter the amount of tickets sold."<<endl;
    cin>>tickets;
    cout<<"What percentage of the ticket revenue goes to administrative costs?"<<endl;
    cin>>percentage;
    cout<<"How much total money is distributed in prizes?"<<endl;
    cin>>total_money;
    cout<<"What is the name of the charity?"<<endl;
    getline(cin name);
    cout<<"Charity:"<<name<<endl;

    Can some one help me finish this please!!!

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Here's a start, how about posting on the right board? While you're at it, read this:
    Quote Originally Posted by kermi3
    Welcome to the boards. If you haven't already done so then please take some time to familiarise yourself with the faq:
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

    Make sure you have a look at the the posting guidelines:
    http://cboard.cprogramming.com/annou...ouncementid=51
    Following the rules will ensure you get a prompt answer to your question.

    Remember, too, that the board has a search facility, a link is at the top of your screen:
    http://cboard.cprogramming.com/search.php
    It will often get you a quicker answer to your questions than waiting for a response to one you have posted.

    It appears that you are posting a homework assignment or other project.

    Please don't ask people to do all your work for you, See the announcement on Homework at the top of all forums to see what is acceptable or PM me. Basically people are happy to help, but they're not going to do it all for you.

    Show us what you've got, show your code (using code tags), or where you're confused and someone will be happy to help you I'm sure. If it's something that you absolutely don't understand how it works, like you have no clue how qsort works, then ask a general question about the function and I'm sure someone will explain it. Though they may not give you all of the code for it, but someone will explain the concept.


    On obivous homework questions especially, I like to remind people of the board's ninth guildeline, while this board is very helpful to people, make sure you have your instructor's permission before seeking help on assignments. While people on these boards are more than happy to help, we discourage people from asking for help on graded work without the instructor's permission, and we claim no repsonsibilty for any cheating or honor violations.

    Feel free to PM me with any questions.

    Good Luck,

    Kermi3
    Read and follow the above instructions. Just use the same thread, because we'll get it moved to the right place for you. But next time, pay attention to what forum you're in.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Why don't you write out in plain english how you would do what you have to do:

    For example:

    Output the name of the charity
    Output the revenue from ticket sales
    - Multiply the number of tickets sold by $5.00
    .....


    Continue doing that. Once you have all of the steps laid out, figure out how you would do each step in C++ code. If you want to type out your method on here and ask fro some help in the specific code, I'm sure people will point you in the right direction.
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM