Help

Hello all, I am really desperate as I have to do one program using C++ language and I don’t know even how to begin so I will be very grateful if someone help me because I know that for advanced people with C++ it is just like 2+2=4.
I will accept any help thanks a lot in advantage.

Here is the program:

Write a program to process the transactions of a brokerage
account for all its customers. The brokerage account handles 10 stocks
of your choice in the Dow Jones Industrial Average. Your program will
ask for the following input for each customer:

* The name of the Dow Jones company of interest to the customer
* Whether the customer wants to buy or sell
* Whether the customer wants stock or options
* The number of stocks/options the customer wants to buy/sell. This
must be a positive number.

After reading these inputs for a customer, your program will calculate
and print the following outputs for that customer:

* The total cost of the transaction.
o Cost of stocks = cost per share * number of shares.
o Cost of options = 10% of the cost of stocks.
* The commission charged.
o For stocks, the commission is $ 9.99 per transaction.
o For options, the commission is 20% of the cost of options.

Before processing each customer, your program will ask the user whether
there are any more customers to process. If the user says y/Y, it will
ask for the inputs, and print the outputs listed earlier. If the user
says n/N, it will calculate and print the following figures for the
company:

* The total number of transactions processed;
* The total cost of all the shares bought and sold;
* The total cost of all the options bought and sold;
* The total commission charged;
* For each company in the portfolio, the balance of stocks = (total
stocks + options bought) - (total stocks + options sold).
* The brokerage house carry-over, which is the sum of the (absolute
value of balance * the cost per stock) of all the stocks.

Note that your program will not know the total number of customers ahead
of time.

Do the data going to be read belong to a file database?In other words,is the program supposed to read the data of each customer(record) from a file and then extract them to the stdout?
Last edited on
Well I don't thnik so. I don't know how are you writing the program but I use either visual studio or just write it in the phobos server.
I have never done programs that has to load other files to run a program so maybe it is not like this. I just write the program compile it and then run it like in phobos g++ name of the program and then a.out or in visual studio it was with F5.


Some details if they are going to help you:

Validate all your inputs, i.e., read each input in a loop and do not exit the loop until a valid value is entered.
Read, validate and return each input in a separate function. Similarly, calculate and return the total cost of the transaction and the total commission in two separate functions.
Use symbolic constants where applicable.
When reading character input, handle both lower and upper case input.
Print money correct to 2 decimal places. If the money is a whole dollar amount, your program should still print 2 zeroes for cents.
Indent and document your code properly. Follow submission guidelines posted on the course web page.
Use the principle of least privilege - no global variables, pass parameters by reference only when necessary.

I will really be thanksful if you help me even it is little :)
I'm just amazed that instructors would give students an assignment without teaching them ANYTHING about the topic at all.

I hope my bleeding sarcasm motivates you to pay attention to your courses more and attempt your own homework.

To not be a complete waste of your time though, here is a start:

1
2
3
4
5
int main()
{

     return 0;
}
Wow. That is one boring homeworky program.
It literally makes me wince.
Topic archived. No new replies allowed.