English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

A commodities broker requires a program to calculate brokerage commissions. Write a program that asks the user if the transaction was a sale or a purchase and then aska for the amount of the transacton. The program should then ask the user where the transaction was made. The user should enter E for the Commodity Exchange, C for the New York Cotton Exchange, or M for the Mercantile Exchange. If the amount was a sale, and was made at the Commodity Exchange, the commission rate is 5.0% of the amount. If a sale is made at the New York Cotton Exchange, the commission rate is 3.7% of the amount. If the transaction was a purchase at the Commodity Exchange, the rate commission is 6.3% of the amount. If a purchase is mdae at the Cotton Exchange, the commission rate is 4.3% of the amount. If a purchase is made at the Mercantile Exchange, the commission rate is 5.7% of the amount

2006-07-24 09:36:03 · 4 answers · asked by 812BOSS 1 in Computers & Internet Programming & Design

For your FYI....No, this is not my homework. It is one of our examples that is used to help us with our homework. I am having some trouble with my C++ course. I dont need for anyone to do my homework for me!

2006-07-24 09:46:54 · update #1

4 answers

Since the question is about writing pseudocode and a problem description - this has nothing to do with C++ or PHP or any language. It is the help you learn how to break down a process into steps so you can write a program to implement it. It is to teach you structured programming.

But what you did not tell us is - do you want a "procedural solution" or an ER (entity relationship) solution? If this is a C++ class you should be learning the later unless you are not very far into the class.

1) prompt user for transaction type [P, S]
2) prompt user for transaction amount
3) prompt user for transaction location [E, C, M]
4) if type is S and location is E then rate is 5% of amount
...

2006-07-24 10:27:59 · answer #1 · answered by Anonymous · 2 0

The way I would do this, albiet with PHP not C++, is to put the commission rates in a double subscripted hash and prompt the user for the important data - type of transaction, location, and amount. Use the type and location to get the rate and multiply.

2006-07-24 10:01:47 · answer #2 · answered by John J 6 · 0 0

Do your Home Work on your own

2006-07-24 09:40:23 · answer #3 · answered by Anonymous · 0 0

main()
{
if( you(pay(me)) > $2000 )
program = writtenby(sheeple_rancher);
}

2006-07-24 09:48:18 · answer #4 · answered by sheeple_rancher 5 · 0 0

fedest.com, questions and answers