Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 23PC

Stock Transaction Program

Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase:

• The number of shares that Joe purchased was 1,000.

• When Joe purchased the stock, he paid S45.50 per share.

• Joe paid his stockbroker a commission that amounted to 2 percent of the amount he paid for the stock.

Two weeks later, Joe sold the stock. Here are the details of the sale:

• The number of shares that Joe sold was 1,000.

• He sold the stock for $56.90 per share.

• He paid his stockbroker another commission that amounted to 2 percent of the amount he received for the stock.

Write a program that displays the following information:

• The amount of money Joe paid for the stock.

• The amount of commission Joe paid his broker when he bought the stock.

• The amount that Joe sold the stock for.

• The amount of commission Joe paid his broker when he sold the stock.

• Display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker. (If the amount of profit that your program displays is a negative number, then Joe lost money on the transaction.)

Blurred answer
Students have asked these similar questions
P1 - Loan Payment Schedule Main Street Bank is offering an annual interest rate discount based on the client’s credit score. The discount for each credit score level is provided in the table below. The lowest credit score is 300 while the highest credit score is 850. For example, the new interest rate for a client with a credit score of 755 and a current interest rate of 4.25% would be 4.25 – 0.75 = 3.50% interest rate   Credit Score Rating Interest Rate Discount 300 - 579 Very Poor 0.00 580 – 669 Fair 0.25 670 - 739 Good 0.50 740 - 799 Very Good 0.75 800 - 850 Exceptional 1.00   Use modular programming concepts Create a program that includes a WHILE loop to generate a payment schedule for loans that are paid in equal monthly payments Input the loan number and retrieve required loan account from MS_LOANS table Output is shown below Monthly interest is calculated by dividing the yearly interest rate by 12 to get a monthly interest…
Stock Transaction ProgramLast month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase:• The number of shares that Joe purchased was 1,000.• When Joe purchased the stock, he paid $32.87 per share.• Joe paid his stockbroker a commission that amounted to 2 percent of the amount he paid for the stock.Two weeks later Joe sold the stock. Here are the details of the sale:• The number of shares that Joe sold was 1,000.• He sold the stock for $33.92 per share.• He paid his stockbroker another commission that amounted to 2 percent of the amount he received for the stock. By writing a pseudo code and flow charts, design a program that displays the following information:● The amount of money Joe paid for the stock.
EXERCISE 1 Stock Transaction ProgramLast month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase:• The number of shares that Joe purchased was 1,000.• When Joe purchased the stock, he paid $32.87 per share.• Joe paid his stockbroker a commission that amounted to 2 percent of the amount he paid for the stock.Two weeks later Joe sold the stock. Here are the details of the sale:• The number of shares that Joe sold was 1,000.• He sold the stock for $33.92 per share.• He paid his stockbroker another commission that amounted to 2 percent of the amount he received for the stock. By writing a pseudo code and flow charts, design a program that displays the following information:● Did Joe make money or lose money? Display the amount of profit or loss after Joe sold the stock and paid his broker (both times).

Chapter 3 Solutions

Starting Out with C++ from Control Structures to Objects (9th Edition)

Ch. 3.5 - Assume the following variable definitions: int a =...Ch. 3.5 - Complete the following program skeleton so it asks...Ch. 3.5 - Prob. 3.13CPCh. 3.6 - Write a multiple assignment statement that assigns...Ch. 3.6 - Write statements using combined assignment...Ch. 3.6 - Prob. 3.16CPCh. 3.7 - Write cout statements with stream manipulators...Ch. 3.7 - Prob. 3.18CPCh. 3.7 - The following program skeleton asks for an angle...Ch. 3.9 - Prob. 3.20CPCh. 3.9 - Assume the variables angle1 and angle2 hold angles...Ch. 3.9 - To find the cube root (the third root) of a...Ch. 3.9 - The cosecant of the angle a is 1sina Write a...Ch. 3 - Assume the following variables are defined: int...Ch. 3 - Prob. 2RQECh. 3 - Prob. 3RQECh. 3 - Complete the following table by determining the...Ch. 3 - Write C++ expressions for the following algebraic...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume qty and salesReps are both integers. Use a...Ch. 3 - Rewrite the following variable definition so that...Ch. 3 - Complete the following table by providing...Ch. 3 - Write a multiple assignment statement that can be...Ch. 3 - Write a cout statement so the variable divSales is...Ch. 3 - Write a cout statement so the variable totalAge is...Ch. 3 - Prob. 14RQECh. 3 - The__________ library function returns the cosine...Ch. 3 - The ___________ library function returns the sine...Ch. 3 - The ________ library function returns the tangent...Ch. 3 - The __________ library function returns the...Ch. 3 - The _________ library functionreturns the...Ch. 3 - The _________ library function returns the natural...Ch. 3 - Prob. 21RQECh. 3 - The _______ library function returns the value of...Ch. 3 - The _________ libraryfunction returns the square...Ch. 3 - The ________ file must beincluded in aprogramthat...Ch. 3 - A retail store grants its customers a maximum...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - using namespace std; int main () { double number1,...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; main { int...Ch. 3 - #inc1ude iostream; using namespace std; main {...Ch. 3 - #inc1ude iostream; using namespace std; int main()...Ch. 3 - What will each of the following programs display?...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - (Assume the user enters George Washington.)...Ch. 3 - (Assume the user enters 36720152. Use a...Ch. 3 - Miles per Gallon Write a program that calculates a...Ch. 3 - Stadium Seating There are three seating categories...Ch. 3 - Test Average Write a program that asks for five...Ch. 3 - Average Rainfall Write a program that calculates...Ch. 3 - Male and Female Percentages Write a program that...Ch. 3 - Ingredient Adjuster A cookie recipe calls for the...Ch. 3 - Box Office A movie theater only keeps a percentage...Ch. 3 - How Many Widgets? The Yukon Widget Company...Ch. 3 - How Many Calories? A bag of cookies holds 30...Ch. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Automobile Costs Write a program that asks the...Ch. 3 - Celsius to Fahrenheit Write a program that...Ch. 3 - Currency Write a program that will convert U.S....Ch. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Property Tax A county collects property taxes on...Ch. 3 - Senior Citizen Property Tax Madison County...Ch. 3 - Math Tutor Write a program that can be used as a...Ch. 3 - Interest Earned Assuming there are no deposits...Ch. 3 - Monthly Payments The monthly payment on a loan may...Ch. 3 - Pizza Pi Joes Pizza Palace needs a program to...Ch. 3 - How Many Pizzas? Modify the program you wrote in...Ch. 3 - Angle Calculator Write a program that asks the...Ch. 3 - Stock Transaction Program Last month Joe purchased...Ch. 3 - Planting Grapevines A vineyard owner is planting...Ch. 3 - Word Game Write a program that plays a word game...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY