Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 > number // read in the value cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

1. Design an effective socialization program for employees.

Answered: 1 week ago