/    Sign up×
Community /Pin to ProfileBookmark

help needed making a simple program

so i need to do this simple program for an assignment, can anyone help me here. weve only learned the simple stuff (loops, assigning variables, arrays, and if statements).

As the manager of the Acme Automobile Dealership, you have to determine the monthly bonus payment for your salespeople. The bonus formula is $50 per car sold plus 1% of total sales. In addition, an extra bonus of 1% is paid on the amount of sales in excess of the average sales per person. For example, if a salesperson sells 3 cars for a total of $53,000 and the average sales per person for the month is $40,000, then this sales person would get a bonus of 3*$50 + .01*($53,000) + .01*($53,000-$40,000) = $810. If a salesperson sells less than the average, he or she does not get the extra bonus, but there is no penalty.

Write a program that that allows input of the following data on each salesperson: name, cars sold, total amount of sales. You will need an array to hold each set of data — a total of three arrays. The program should keep asking for data until the user clicks cancel instead of ok in the prompt box. In order to calculate the average, you will need an accumulator variable to keep a running total inside the loop. Once all the data has been entered, the program should calculate the average by dividing the accumulator by the number of salespeople. The the program should print the name of each salesperson and his total bonus for the month.

any help would be greatly appreciated.

please IM me at youlovetonyt or email me at [email][email protected][/email] if you can help

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Shift4SMSApr 08.2004 — [i]Originally posted by youlovetonyt [/i]

[B]so i need to do this simple program for an assignment, can anyone help me here. weve only learned the simple stuff (loops, assigning variables, arrays, and if statements).[/B][/QUOTE]

I think you summed up the entire problem and solution in your first paragraph -- "i need to do a simple program", "we've only learned simple stuff". The formula you described is VERY straight forward and the solution can be done with loops, assigning variables, arrays and if statements. Just THINK and connect the dots.
×

Success!

Help @youlovetonyt spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...