1. Engineering
  2. Computer Science
  3. you cannot use anry c techniques that are covered in...

Question: you cannot use anry c techniques that are covered in...

Question details

You cannot use anry C++ techniques that are covered in Chapters 5 and higher. Material from Chapters 1 through 4 and any extra code in this handou is alowed, only. Even though functions are discussed in chapters 2 and 3, you cannot we them until they are covered in Chapler 8 Loops are not necessary to solve this project In this program mathematical calaulations invoving the purchase and sale of stock are to be performed. The user will be prompted for the name of the stock, the number of shares of the stock and the buy price of the stock S months after buying the stock, the stock is sold for a sell price that is entered by the user. From this infarmation several calculations are made and information regarding the purchase and sale af the slock is output. In bath cases af selling and buying the stock, the broker is paid a commissian. For buying the stock, the commission is 2% and for seling the stock the commission is 1.5%. Furthermore the profit (or 1088) of the stock is subject to a 25% tax rate In the case of a loss on the sale or stock the caloulated amount will be nogative and will be a tax credit of that amount. The input order of information, the cakculations to be performed and the order of output information are listed below (this inlormation is aso observed by running the sample solution) Input order of intormation .Name of he stock-read into a string variable Number af shares of stock-read inta an integer variable .Purchase price (per sharc) of the stock- read into a floating point variable . Sell price (per share) of the stock read imo a floating point variable Calculations to be performed (all variables holding these values should be floats) * The broker commission for purchasing the stock (2% or the cost of buying the stock . The total coet of the purchase:cost of buying the stock plus the buy commission * The broker commission for selling the stock {1.5% of the return from sale of the stock . The total return from the sale of tha stock return from the sale of the stock minus the sal commission paid . The net profit [or loss) trom the stock purchase (total return minus the total cost of the purchase).f this value is negative then it is a loss * Tax on the prom (or tax credit on the loss) which is 25% of the net protor loss Output order of information: The number of shares and name of the stock . The commission for purchase of the stock The total cost of the purchase . The commission for the selling of the stock e The total return from the sale . The net profit (or loss .The tax on the net profit (or tax credit an the net loss) The format and information required is ilustrated in the sample solution. All floating point values are to be written with two digits of precision. cost af buying the stock is the buy price per share times the number of she neturm from the sale of the stock is the sell prica par shane times the number afsha Page 2 of 3 Spring 2019 CPE211 Project Asaignment Project 3 (1) Use variables of the data types specified in the description. 2) Obtain the necessary stock inlormation as specified abave Prompt for a value, read the value and echo print the value read . Run the sample solution to see the order of input and the prompt phrases (3) Perform the calculations for the values speofied above. (4) Output the information to the teminal as ilustrated in the sample solution (8) Precision of floating point numbers output is to be two decimal places. cout << Enter in an integer: prompt for a value cin >> number // read in the value cout << number << endl echo print the value entered

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution