473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

I need help with a assigment

13
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
Oct 17 '06 #1
16 2250
Banfa
9,065 Expert Mod 8TB
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.
Oct 17 '06 #2
negrito
13
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?
Oct 17 '06 #3
Banfa
9,065 Expert Mod 8TB
Well is the assigment to right C or C++?
Oct 17 '06 #4
negrito
13
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
Oct 17 '06 #5
negrito
13
Well is the assigment to right C or C++?
can u help me out my assigment is due tomorrow pls help me.
Oct 17 '06 #6
Banfa
9,065 Expert Mod 8TB
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

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int value;
  8.  
  9.     cout << "Please enter an integer: ";
  10.     cin >> value;
  11.  
  12.     cout "You entered the value " << value << endl;
  13. }
  14.  
Oct 17 '06 #7
negrito
13
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

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int value;
  8.  
  9.     cout << "Please enter an integer: ";
  10.     cin >> value;
  11.  
  12.     cout "You entered the value " << value << endl;
  13. }
  14.  
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
Oct 18 '06 #8
Banfa
9,065 Expert Mod 8TB
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.
Oct 18 '06 #9
negrito
13
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
Oct 18 '06 #10
negrito
13
That's OK then :)

Just remember to ask sooner next time.
Banfa so how do i converted to percentage
Oct 18 '06 #11
Banfa
9,065 Expert Mod 8TB
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
Oct 18 '06 #12
negrito
13
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<iostream>
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
Oct 18 '06 #13
Banfa
9,065 Expert Mod 8TB
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

Expand|Select|Wrap|Line Numbers
  1. PROMPT FOR TicketsSold
  2. PROMPT FOR %AdministerativeOverhead
  3. PROMPT FOR TotalAmountofPrizeMoneyDistributed
  4. PROMPT FOR SoccerTeamName
  5.  
  6. REMARK Each Ticket Cost $10
  7.  
  8. TotalRevenue = 10 * TicketsSold
  9.  
  10. AbsoluteAdministerativeOverhead = TotalRevenue * %AdministerativeOverhead / 100
  11.  
  12. Balance = TotalRevenue - (AbsoluteAdministerativeOverhead + TotalAmountofPrizeMoneyDistributed)
  13.  
  14. OUTPUT SoccerTeamName
  15. OUTPUT TotalRevenue
  16. OUTPUT AbsoluteAdministerativeOverhead 
  17. OUTPUT TotalAmountofPrizeMoneyDistributed
  18. OUTPUT Balance
  19.  
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.
Oct 18 '06 #14
negrito
13
Hey banfa were do i get the administrative %?fot this problem
Oct 22 '06 #15
negrito
13
It looks like it's getting there.

As pseudo code you want

Expand|Select|Wrap|Line Numbers
  1. PROMPT FOR TicketsSold
  2. PROMPT FOR %AdministerativeOverhead
  3. PROMPT FOR TotalAmountofPrizeMoneyDistributed
  4. PROMPT FOR SoccerTeamName
  5.  
  6. REMARK Each Ticket Cost $10
  7.  
  8. TotalRevenue = 10 * TicketsSold
  9.  
  10. AbsoluteAdministerativeOverhead = TotalRevenue * %AdministerativeOverhead / 100
  11.  
  12. Balance = TotalRevenue - (AbsoluteAdministerativeOverhead + TotalAmountofPrizeMoneyDistributed)
  13.  
  14. OUTPUT SoccerTeamName
  15. OUTPUT TotalRevenue
  16. OUTPUT AbsoluteAdministerativeOverhead 
  17. OUTPUT TotalAmountofPrizeMoneyDistributed
  18. OUTPUT Balance
  19.  
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.
banfa so far i got this:
#include <iostream>
using namespace std;
int main()
{
int tickets,value;
cout<<"Name of soccer team";
cout<< "number of tickets sold?";
cin>>tickets;
Oct 22 '06 #16
Banfa
9,065 Expert Mod 8TB
Hey banfa were do i get the administrative %?fot this problem
Read your problem description, you are told to ask the user.
Oct 23 '06 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dean Mitchell | last post by:
Hi, I have a simple STL map container that maps a stl string to a structure as follows. typedef std::map<std::string,TASKLIST> PCLIST; In a class I have a member variable that is defined as...
7
by: MIA | last post by:
Hi, I have an nxn array in which in each row is consisting of +ve and -ve numbers, such that -ve number comes before +ve numbers. e.g. -45 | -9 | -3 | 2 =================== -5 | -9 | 21 |...
22
by: San | last post by:
Hi, I wrote two simple constructors (one of them default) to initialize a student object. Student::Student(string name) { student_name = name; student_id = LATEST_ID + 1;...
18
by: bArT | last post by:
Hi! I have a problem with such situation. I have a class like below and have some pointers (ptr1 and ptr2). I dynamically allocate memory in constructor and I free in destructor. For one pointer...
2
by: yopwojtek | last post by:
Hello All, i know from some tutorials, that copy constructor and assigment operator is not inherited from base to derived class. i think it make sense but i wrote a little example: class Base {...
5
by: Hanno Boettcher | last post by:
Hi there, I got a little problem with a program I'm writing: I use some structs, the definitions are as follows: struct GitterPunkt{ float a; float d; float p;
1
by: Alexandru Taeaha | last post by:
i am trying to make a program that opens diferent programs from th numpad key. my question is :can i make those keys have more the one assigment like for example standard if i press it opens...
5
by: Tuomas | last post by:
#!/usr/bin/python """test pydev_0.9.3/../pylint""" __revision__ = "test_mod 0.1 by TV 06/10/22" lst = lst = map(lambda x: x.strip(), lst) result = """ No config file found, using default...
8
by: Pinko | last post by:
Part one of mye assignment is: The method must be declared public static, accept a string as a parameter, and return a string. The method receives a name on the form "Firstname Lastname" and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.