Concept explainers
Stock Transaction
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.)
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
EBK STARTING OUT WITH C++ FROM CONTROL
Additional Engineering Textbook Solutions
C How to Program (8th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Java How To Program (Early Objects)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Software Engineering (10th Edition)
Problem Solving with C++ (9th Edition)
- Formatting Customer Names Build a function that displays a customer's name and location if applicableSuppose that you are building a Customer Relationship Management (CRM) system, and you want to display a user record in the following format: John Smith (California). However, if you don't have a location in your system, you just want to see "John Smith." Create a format_customer() function that takes two required positional arguments, first_ name and last_name, and one optional keyword argument, location. It should return a string in the required format. Create the customer.py file. Define the format_customer() function. Open a Python shell (Or Jupyter Notebook) and import your format_customer() function. Try running a few examples. The calls should look like this: from customer import format_customerformat_customer('John', 'Smith', location='California') and the output should look like this: John Smith (California) In [ ]:arrow_forwardTopic name: data structures please solve quicklyarrow_forwardc++arrow_forward
- (Numerical) Write an assignment statement to calculate the nth term in an arithmetic sequence. This is the formula for calculating the value, v, of the nth term: v=a+(n1)d a is the first number in the sequence. d is the difference between any two numbers in the sequence.arrow_forwardSubject: Disrete Structures A landline Telephone number contains 7 digits. How many Landline numbers can be formed if the first number must be a 4, 6 or 2. The second and third number must match each other and the last digit can be anything from 1 to 5.arrow_forwardBook (ISBN, Category, BTitle, Quantity,CID) Sales (SalesNo, Month_Year, TotalSales, ISBN) Shop (RegNo, Location, SalesNo) Customer (CID, CName, TelNo, Age) (ii)What was the title and category of the book that the customer Emekabought? (iii)Who purchased the book in the Coding category,or the quantity is greater than two? (iv)What isthe total sales and location of the shop with the registration number "REG KL 100" in the month ofApril 2021? (v)Display the identification number, name, age together with the total salesof the customers who purchasedthe Computer Fundamentals title book.arrow_forward
- Pythonarrow_forwardCustomer (CID, CName, Street, City, State, Gender)Agent (AgentID, GName, Position, Salary, Gender, BranchNo)Invoice(InvoiceNo, CID, AgentID, Product, Quantity, Total_amt) List the name of agents, position and salary for all agents that begin with ‘Sales’ in their title position and with salary more than the average salary. Example of titles with ‘Sales’ are ‘Sales Executive’, ‘Sales Manager’, ‘Salesman’ and many other titles. Sort the list by name in alphabetical orderarrow_forwardPlease right solution only please fast u will like itarrow_forward
- ASSIGNMENT BRIEF Introduction Roulette is a popular casino game named after the French word for 'little wheel'. In the game, players may choose to place bets on single numbers or various groupings which will determine their payout. To determine the winning number a ball is spun in the opposite direction of a spinning wheel. As the ball loses momentum it comes to rest in one of the slots of the wheel. Winnings are then paid to anyone who places a successful bet. n 00 2. 1ST12 2ND12 3RD12 1T018 EVEN ODD |19то36 Figure 1: Layout of a European roulette table Numbers can be classified in several ways: 1. Red or Black 2. Odd or Even 3. High or Low - if a number is in the first half of the table it is considered low (1-18). If a number is in the second half of the table, it is considered high (19-36). 4. Dozens - a number can be in the first dozen(1-12), second dozen (13-24) or third dozen (25-36) 5. Columns - A number may be in any of the three columns of the table 6. Zero - the number '0'…arrow_forwardProblem 2 Concert Tickets 8 points There are three tickets for a concert. The VIP tickets cost $120, premium tickets cost $80, and regular tickets cost $40. Prompt the user how many tickets of each category he would like. Then print an invoice with overview of the order and total price. Include a sales tax of 9.25%. How many tic kets would you like to order? VIP Tickets ($120): 0 Premium Tickets ($80) : 4 Regular Tickets ($40): 2 Invoice: $120 x 0= $ 0.00 $ 80 X 4 = $320.00 $ 40 x 2 = $ 80.00 9.25% $ 37.00 VIP: Premium: Regular: Sales Tax: Total Price: $437.00arrow_forwardASSIGNMENT: Student Data Write a program that uses two structures Name and Student to store the following information for multiple students: 1. Create a NAME structure that consists of • First Name, • Middle Initial, and • Last Name. 2. Create a STUDENT structure that contains student information (Include the NAME structure within the Student information structure) o Name o ID o email • SSN • Program (an enum type containing programs such as CSCI, DBMS, INFM, SDEV)arrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr