I need help with a assigment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • negrito
    New Member
    • Oct 2006
    • 13

    I need help with a assigment

    I need help to create this program:
    This program will take user input in the folowing order:
    1.number of tickets sold.
    2.percentage of ticket revenue which goes to administrative costs.This input will be enter in percent format,your program must convert this to a decimal fraction
    3.Total amount of prize money distributed.
    4.name of soccer team.
    The program will output the following information in the following order:
    1 Name of soccer team
    2 Total revenue generated from tickets sales.The price of each ticket is currently fixed at $10.00
    3 Total amount of administrative overhead
    4 Total amount of prize money overhead
    5 Balance remaining for the soccer fund.

    can some one help me out there i will apreciatded.I'm a student that just started in c++ programing so can some one help me Thank you
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Start by writing a basic program that takes user input and displays it back to the user using cin and cout.

    Once you have this working you can start on manipulating the data to the desired form by the question.

    Comment

    • negrito
      New Member
      • Oct 2006
      • 13

      #3
      Originally posted by Banfa
      Start by writing a basic program that takes user input and displays it back to the user using cin and cout.

      Once you have this working you can start on manipulating the data to the desired form by the question.
      What code should i use for this program?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Well is the assigment to right C or C++?

        Comment

        • negrito
          New Member
          • Oct 2006
          • 13

          #5
          Originally posted by Banfa
          Well is the assigment to right C or C++?
          It's for c++ can u help me out with it on how to write it and about to convert the decimal percent

          Comment

          • negrito
            New Member
            • Oct 2006
            • 13

            #6
            Originally posted by Banfa
            Well is the assigment to right C or C++?
            can u help me out my assigment is due tomorrow pls help me.

            Comment

            • Banfa
              Recognized Expert Expert
              • Feb 2006
              • 9067

              #7
              Originally posted by negrito
              can u help me out my assigment is due tomorrow pls help me.
              You should have asked for help sooner, sorry but I don't do people assignments for them.

              If you are using C++ then cout and cin are the way to print messages and get input

              Code:
              #include <iostream>
              
              using namespace std;
              
              int main()
              {
                  int value;
              
                  cout << "Please enter an integer: ";
                  cin >> value;
              
                  cout "You entered the value " << value << endl;
              }

              Comment

              • negrito
                New Member
                • Oct 2006
                • 13

                #8
                Originally posted by Banfa
                You should have asked for help sooner, sorry but I don't do people assignments for them.

                If you are using C++ then cout and cin are the way to print messages and get input

                Code:
                #include <iostream>
                
                using namespace std;
                
                int main()
                {
                    int value;
                
                    cout << "Please enter an integer: ";
                    cin >> value;
                
                    cout "You entered the value " << value << endl;
                }
                I'm asking for some one to help me or guide me ,not for some one to do my assigment for me i'm asking for help i hope you dont take it in an offensive way but thanks for all the help you are giving me thanks a lot

                Comment

                • Banfa
                  Recognized Expert Expert
                  • Feb 2006
                  • 9067

                  #9
                  Originally posted by negrito
                  I'm asking for some one to help me or guide me ,not for some one to do my assigment for me i'm asking for help i hope you dont take it in an offensive way but thanks for all the help you are giving me thanks a lot
                  That's OK then :)

                  Just remember to ask sooner next time.

                  Comment

                  • negrito
                    New Member
                    • Oct 2006
                    • 13

                    #10
                    Originally posted by Banfa
                    That's OK then :)

                    Just remember to ask sooner next time.
                    Ok Thanks ,So the code u send me is the one I should use so for this program i should start with
                    int value; that should do for most of the program
                    Just help me a little bet more on it

                    Comment

                    • negrito
                      New Member
                      • Oct 2006
                      • 13

                      #11
                      Originally posted by Banfa
                      That's OK then :)

                      Just remember to ask sooner next time.
                      Banfa so how do i converted to percentage

                      Comment

                      • Banfa
                        Recognized Expert Expert
                        • Feb 2006
                        • 9067

                        #12
                        Easy divide by 100, that is all percentage means 1/100ths

                        so

                        5% of 231 is

                        5/100 * 231

                        Since you are doing this on a computer rearrange to do the multiplication first to preserve precision

                        231 * 5 / 100

                        = 11.55 or 11 if you are using integer arithmtic

                        Comment

                        • negrito
                          New Member
                          • Oct 2006
                          • 13

                          #13
                          Originally posted by Banfa
                          Easy divide by 100, that is all percentage means 1/100ths

                          so

                          5% of 231 is

                          5/100 * 231

                          Since you are doing this on a computer rearrange to do the multiplication first to preserve precision

                          231 * 5 / 100

                          = 11.55 or 11 if you are using integer arithmtic
                          so my program shoul go like this
                          #include<iostre am>
                          using namespace std;
                          int main ()
                          {
                          int value;
                          cout<<"name of charity";
                          cout << "number of tickets sold";
                          cin >>ticket value
                          cout<<Total amount of administrative overhead";
                          cin >>tickets sold*10/100;

                          does this look correct help me out im new at this an i'm trying to figure it out so please give a hand im not trying for u to do my homewrok but im trying to get an idea

                          Comment

                          • Banfa
                            Recognized Expert Expert
                            • Feb 2006
                            • 9067

                            #14
                            Originally posted by negrito
                            does this look correct help me out im new at this an i'm trying to figure it out so please give a hand im not trying for u to do my homewrok but im trying to get an idea
                            It looks like it's getting there.

                            As pseudo code you want

                            Code:
                            PROMPT FOR TicketsSold
                            PROMPT FOR %AdministerativeOverhead
                            PROMPT FOR TotalAmountofPrizeMoneyDistributed
                            PROMPT FOR SoccerTeamName
                            
                            REMARK Each Ticket Cost $10
                            
                            TotalRevenue = 10 * TicketsSold
                            
                            AbsoluteAdministerativeOverhead = TotalRevenue * %AdministerativeOverhead / 100
                            
                            Balance = TotalRevenue - (AbsoluteAdministerativeOverhead + TotalAmountofPrizeMoneyDistributed)
                            
                            OUTPUT SoccerTeamName
                            OUTPUT TotalRevenue
                            OUTPUT AbsoluteAdministerativeOverhead 
                            OUTPUT TotalAmountofPrizeMoneyDistributed
                            OUTPUT Balance
                            PROMPT FOR is a combination of cout to print a prompt to the user followed by cin to read a value.

                            OUTPUT is just a cout to output the data.

                            Comment

                            • negrito
                              New Member
                              • Oct 2006
                              • 13

                              #15
                              Hey banfa were do i get the administrative %?fot this problem

                              Comment

                              Working...