Starting Out with Python plus MyProgrammingLab with Pearson eText -- Access Card Package (3rd Edition)
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 12PE

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 2,000.

▪ When Joe purchased the stock, he paid $40.00 per share.

▪ Joe paid his stockbroker a commission that amounted to 3 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 2,000.

▪ He sold the stock for $42.75 per share.

▪ He paid his stockbroker another commission that amounted to 3 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 for which Joe sold the stock.

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

▪ Display the amount of money that Joe had left when he sold the stock and paid his broker (both times). If this amount is positive, then Joe made a profit. If the amount is negative, then Joe lost money.

Blurred answer
05:27
Students have asked these similar questions
4. Contoso Workshops Modify the Contoso Workshops assignment from Chapter 3.  The modified program takes as input the number associated with the workshop choice and the number associated with the location choice. The program will calculate and display the registration fee, lodging cost, and Total for the selected workshop and location. You will use three functions for this program. One function will display the Workshop and Lodging menus and return the menu choices for each, a second function will calculate and return the lodging cost, and a third function will calculate and return the Total Cost. The tables below show the workshops  and lodging information.  Be sure to define a main function. Workshop Number of Days Registration Fee Handling Stress 3 $2,000 Time Management 3 $800 Supervision Skills 3 $1,500 How to Interview 1 $500 Lodging Location Lodging Fees per Day Austin $150 Chicago $225 Phoenix $175…
4.23 (Financial application: payroll) Write a program that reads the following information and prints a payroll statement: Employee’s name (e.g., Smith)Number of hours worked in a week (e.g., 10)Hourly pay rate (e.g., 9.75)Federal tax withholding rate (e.g., 20%)State tax withholding rate (e.g., 9%) A sample run is shown below:Enter employee's name: SmithEnter number of hours worked in a week: 10Enter hourly pay rate: 9.75Enter federal tax withholding rate: 0.20Enter state tax withholding rate: 0.09Employee Name: SmithHours Worked: 10.0Pay Rate: $9.75Gross Pay: $97.5Deductions:Federal Withholding (20.0%): $19.5State Withholding (9.0%): $8.77Total Deduction: $28.27Net Pay: $69.22 Requirement: Requirements:  Input and output must match the format provided in the exercise sample runs Currency must be displayed properly: You must have a dollar sign ($) and 2 places after the decimal (dollars and cents) You must use printf rather than the goofy trick from earlier chapters Appropriate…
The Salary Program: Modify the program from the textbook (Program 1-1,see below) which reads the number of hours an employee works reads the pay rate per hour computes the pay for the employee.  Add the following steps: a)    Read an amount of bonus paid to the employee.b)    Compute the total pay as pay plus bonus.c)    Compute the tax at 30% of the total pay.d)    Compute the net pay as total pay minus tax, and e)    Print a report showing: total pay, tax deduction, and net pay.   Algorithm: 1.    Prompt the user for number of hours.2.    Read the value for hours.3.    Prompt the user for hourly rate.4.    Read the hourly rate.5.    Prompt the user for amount of bonus.6.    Read the value for bonus.7.    Compute the pay.8.    Compute the totalPay by adding bonus to pay.9.    Compute the tax deduction by multiplying 30% times totalPay.10. Compute the netPay by subtracting tax from totalPay.11. Neatly print and label the following: a.    totalPay b.    tax c.    netPay Put your…

Chapter 2 Solutions

Starting Out with Python plus MyProgrammingLab with Pearson eText -- Access Card Package (3rd Edition)

Ch. 2.5 - Which of the following are illegal variable names...Ch. 2.5 - Prob. 12CPCh. 2.5 - Is the following assignment statement valid or...Ch. 2.5 - Prob. 14CPCh. 2.5 - Look at the following assignment statements:...Ch. 2.5 - What will be displayed by the following program?...Ch. 2.6 - You need the user of a program to enter a...Ch. 2.6 - Prob. 18CPCh. 2.7 - Prob. 19CPCh. 2.7 - Prob. 20CPCh. 2.7 - Prob. 21CPCh. 2 - A ______ error does not prevent the program from...Ch. 2 - Prob. 2MCCh. 2 - A(n) __________ is a set of well-defined logical...Ch. 2 - An Informal language that has no syntax rules and...Ch. 2 - A _______ is a diagram that graphically depicts...Ch. 2 - A ______ is a sequence of characters. a. char...Ch. 2 - Prob. 7MCCh. 2 - Prob. 8MCCh. 2 - A string literal in Python must be enclosed in...Ch. 2 - Prob. 10MCCh. 2 - A(n) __________ makes a variable reference a value...Ch. 2 - This symbol marks the beginning of a comment in...Ch. 2 - Which of the following statements will cause an...Ch. 2 - In the expression 12 + 7, the values on the right...Ch. 2 - This operator performs integer division. a. // b....Ch. 2 - This is an operator that raises a number to a...Ch. 2 - This operator performs division, but instead of...Ch. 2 - Prob. 18MCCh. 2 - Which built-in function can be used to read input...Ch. 2 - Prob. 20MCCh. 2 - Programmers must be careful not to make syntax...Ch. 2 - In a math expression, multiplication and division...Ch. 2 - Variable names can have spaces in them.Ch. 2 - In Python, the first character of a variable name...Ch. 2 - If you print a variable that has not been assigned...Ch. 2 - What does a professional programmer usually do...Ch. 2 - What is pseudocode?Ch. 2 - Computer programs typically perform what three...Ch. 2 - If a math expression adds a float to an int, what...Ch. 2 - What is the difference between floating-point...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Write a Python statement that assigns the sum of...Ch. 2 - Write a Python statement that subtracts the...Ch. 2 - Write a Python statement that multiplies the...Ch. 2 - Prob. 8AWCh. 2 - What would the following display? num = 99 num = 5...Ch. 2 - Assume the variable sales references a float...Ch. 2 - Assume the following statement has been executed:...Ch. 2 - What will the following statement display?...Ch. 2 - Personal Information Write a program that displays...Ch. 2 - Sales Prediction A company has determined that its...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Distance Traveled Assuming there are no accidents...Ch. 2 - Sales Tax Write a program that will ask the user...Ch. 2 - Miles-per-Gallon A car's miles-per-gallon (MPG)...Ch. 2 - Tip, Tax, and Total Write a program that...Ch. 2 - Celsius to Fahrenheit Temperature Converter Write...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Transaction Program Last month, Joe...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
This type of method does not return a value. a. null b. void c. empty d. anonymous

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Find the error in the following class: public class MyClass { private int x; private double y; public void MyCl...

Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)

What is denormalization?

Database Concepts (8th Edition)

What does it mean to let the user control a loop?

Starting Out with Java: Early Objects (6th Edition)

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
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY