• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

c++ help?

Mew2King

King of the Mews
Joined
Jul 18, 2002
Messages
11,263
Location
Cinnaminson (southwest NJ 5 min drive from Philly)
I need a new C++ contact to help me with stuff. Does anyone want to volunteer XD?

this is current assignment. I'm just stupid.


Structured Programming & Design Assignment #6

For the upcoming season, Phillies management has decided to pay the players bonuses based on batting average AND fielding excellence. For non-baseball enthusiasts, batting average is the number of hits divided by total number of at-bats for a player (3 decimals normally are shown). Fielding is based on the number of errors committed.
//battingAverage = numOfHits / totalNumOfAtbats?


The following chart shows the bonus amount for batting average:

Less than .300 $0
.300 - .325 $50,000
.326 - .350 $100,000
Over .350 $150,000

The following chart shows the bonus amount for fielding excellence:

< 20 errors $10,000
20 - 30 errors $5,000
Over 30 errors $0

The program must contain the following:

1. A separate function must handle EACH type of bonus.
//function for fieldingBonusMoney();
//function for battingBonusMoney();
2. Input will require the player’s name, number of errors, number of hits, and number of at-bats.
//cout << “input player’s name: ”;
//cin >> playerName;
//cout << “input number of errors: ”;
//cin >> numOfErrors;
//cout << “input number of hits: “;
//cin >> numOfHits;
//cout << “input number OfAtBats: “;
//cin >> numOfAtBats;
3. You should have 2 output report sections:
- one showing fielding bonus $$
- one showing batting bonus $$
o //Output is at the very bottom and is easy
4. You should also display the total bonus received for both.
5. Be sure to provide a ‘readable’ output report. You design the output report.
6. This program should handle any number of Phillies players.
 

AltF4

BRoomer
BRoomer
Joined
Dec 13, 2005
Messages
5,042
Location
2.412 – 2.462 GHz
Do not post your homework assignments verbatim and expect a response. If you have a specific issue you don't understand, everyone would be happy to help.
 

TL?

Smash Ace
Joined
Apr 6, 2008
Messages
576
Location
Chicago, IL
This is so easy it hurts.

All you need to know is:
how to use cin and cout
how to divide
if/else statements
defining a function
 
Top Bottom