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 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.
Learn your wayIncludes step-by-step video
Chapter 2 Solutions
Starting Out with Python (3rd Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Database Concepts (8th Edition)
Starting Out with Java: Early Objects (6th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out with C++: Early Objects (9th Edition)
- c++ taskarrow_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_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_forward
- Holiday Travel Vehicle (HTV) sells new recreational vehicles and travel trailers. When new vehicles arrive at HTV, a new vehicle record is created. Included in the new vehicle record are a vehicle serial number, name, model, year, manufacturer, and base cost. When a customer arrives at HTV, he or she works with a salesperson to negotiate a vehicle purchase. When a purchase has been agreed upon, a sales invoice is completed by the salesperson. The invoice summarizes the purchase, including full customer information, information on the trade-in vehicle (if any), the trade-in allowance, and information on the purchased vehicle. The invoice also summarizes the final negotiated price, plus any applicable taxes and license fees. If the customer requests dealer-installed options (simply options), they are listed on the invoice as well. A customer may decide to have no options added to the vehicle or may choose to add many options. Dealer-installed options are described by an option code,…arrow_forwardTopic name: data structures please solve quicklyarrow_forwardFormatting 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_forward
- Introduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: Each team has a name, which is one of the uppercase letters A-Z. No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same number of members. No two runners cross the finish line at the same time – i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A’s runners finished in 3rd, 5th and 6th place. Team Z’s runners finished in 1st, 2nd and 4th place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by the number of people on…arrow_forward11 Worksheet 5 Note:Solution using Matlab Code Write a program that prompts the user to enter a number within the range of 1 through 7, those numbers represent the weekdays as shown in the table. If the entered number is more than 7, display 'invalid day'. Number 1 2 3 4 5 6 7 Day Sunday Monday Tuesday Wednesday Thursday Friday Saturday Type of the day Workday Workday Workday Workday Workday Weekend Weekend The program should continue to repeat itself 10 times, after which, the program should stop. Furthermore, the program should be able to show a message saying if this is a 'workday' or a 'weekend day'. Note: you are required to add a comment beside your command. Hint: to add a comment you may use the % sign. thank guys you dodo great.arrow_forwardEmployee view attendance report The employee must be logged in to the system to perform this function. The employee selects the report period (range of dates: from - to). The employee selects "show report". Range of dates for the report must be maximum 3 months, so if the range is invalid, the system displays an error message. The system displays every working day in the report with the status of the employee in this day, which could be one of the following: on time, late, did not come. One actor? One use case name? One class ? Attributes for the class ? One relation between classes ?arrow_forward
- Task 2 Use function to calculate Computer Skills. Both skills Yes: show "Sufficient", only one skill: show "Good", no skill: show "Poor" Computer Skills Student ID 521370 811298 780223 528112 427747 207676 158877 154194 480967 962948 701444 803700 268544 975048 204401 846716 127466 621984 285594 826758 972888 739477 857713 339297 249521 868320 872950 198271 702356 726662 365857 136850 492928 850557 987114 776815 666031 904552 161237 268716 Software Skill Yes Yes Yes No Yes Yes No Yes No No Yes No No Yes Yes No No No Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes No Yes No Yes No Yes No Yes Yes Yes Hardware Skill No Yes Yes No Yes Yes No No Yes No Yes No No No No Yes No No No No Yes Yes Yes Yes No No Yes No Yes No Yes Yes | No Yes Yes Yes No Yes Yes Yesarrow_forwardC++ Language Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places. INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater…arrow_forwardc++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