Concept explainers
Order Status
The Middletown Wholesale Copper Wire Company sells spools of copper wiring for $100 each and ships them for $10 apiece. Write a
• The number of spools ordered.
• The number of spools in stock.
• Any special shipping and handling charges (above the regular $10 rate).
The second function receives as arguments any values needed to compute and display the following information:
• The number of ordered spools ready to ship from current stock.
• The number of ordered spools on backorder (if the number ordered is greater than what is in stock).
• Total selling price of the portion ready to ship (the number of spools ready to ship times $100).
•Total shipping and handling charges on the portion ready to ship.
• Total of the order ready to ship.
The shipping and handling parameter in the second function should have the default argument 10.00.
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
STARTING OUT WITH C++ MPL
Additional Engineering Textbook Solutions
Java How To Program (Early Objects)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out with Programming Logic and Design (4th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
- In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:KE=12mv2The variables in the formula are as follows: KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Write a function named kinetic_energy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Write a program that asks the user to enter values for mass andvelocity, then calls the kinetic_energy function to get the object’s kinetic energy.arrow_forwardSalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of last five years. The data should be collected for n employees. The value of n should also be accepted as input. All amounts should be displayed with three decimal places. The output should be displayed as a table containing the Employee name, Average Sales and Bonus. The program must define and use a function with Total Sales as a parameter and should calculate the Average Sales and Bonus for cach employee. Bonus must be calculated based on the following table: Average Sales (AS) AS<5000 50002AS<7500 75002AS<10000 AS210000 Bonus | 1% of Average Sales 2% of Average Sales 4% of Average Sales 7% of Average Sales Sample Output ====: Employee Name Average Sales Bonus === AFRAH 8577.000 343.080 ASMA 6476.800 129.536 4943.000 10260.000 ATHEER 49.430 718.200 315.064 135.608 352.888 365.072 305.240 НАЈАR HAJAR 7876.600 6780.400 8822.200 9126.800 7631.000 7580.400 MALLAK MARYAM NOORA SAHAR SHEFAA…arrow_forwardPAYTHON CODEarrow_forward
- FizzBuzz Interview Question Create a function that takes a number as an argument and returns "Fizz", "Buzz" or "FizzBuzz". If the number is a multiple of 3 the output should be "Fizz". If the number given is a multiple of 5, the output should be "Buzz". If the number given is a multiple of both 3 and 5, the output should be "FizzBuzz". If the number is not a multiple of either 3 or 5, the number should be output on its own as shown in the examples below. The output should always be a string even if it is not a multiple of 3 or 5. Examples fizz_buzz (3) "Fizz" fizz_buzz (5) → "Buzz fizz_buzz (15) "FizzBuzz" fizz_buzz (4) "4" 11arrow_forwardFuture Investment Value = investment amount * (1 + monthly interest)^(number of years * 12) Using this formula, write a function in Python called futureValue that prompts the user to enter an investment amount, an annual percentage interest rate, and the amount of years. The function should accept the input as arguments. The interest rate should have a default value of 7%. You can add default values of your choice for the amount of years. This function should print out a table that displays the future values. Demonstrate this function in another function called main. Format your output by two decimal places. Output Example: Enter the amount you want to invest: 1000 [Enter] Enter the interest rate for your investment: [Enter] Enter the number of years you want to invest this money: 30 [Enter] Years Future Value 1 1093.81 2 1196.41 ........ 30 14730.58arrow_forwardQ6: Complete the function that takes in a number x, and returns the value 1 if x > 0, otherwise it is 0 - this is called a step function ]: def step_function(x): "given x compute the correct value to return. Note you need to include the return statement here""" II II II # your code herearrow_forward
- 110% Assignment 3- S4.pdf SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of last five years. The data should be collected for n employees. The value ofn should also be accepted as input. All amounts should be displayed with three decimal places. The output should be displayed as a table containing the Employee name, Average Sales and Bonus. The program must define and use a function with Total Sales as a parameter and should calculate the Average Sales and Bonus for each employee. Bonus must be calculated based on the following table: Average Sales (AS) ASAS<7500 75002AS<10000 AS210000arrow_forwardA program contains the following function. int cube(int num) {return num * num * num; }Write a statement that passes the value 4 to this function and assigns its return value to the variable result.arrow_forwardAir Pacific Limited, Fiji's international airline, operates international and domestic services around the Pacific and to North America and Hong Kong. It has its head office at the Air Pacific Maintenance & Administration Centre in Nadi. You are required to write a program that passengers can use to chose seats for aircraft FJ501. The aircraft has 13 rows with 5 seats in each row. Rows 1 to 4 are first class, the remaining rows are economy class. The program should display the seating plan for the aircraft. Empty seats are shown with x and the seats that are booked will have the passenger name (first name plus initials of other names) on it. To reserve a seat, they have to provide their ticket type (First Class or Economy Class), the seat they prefer and their name (first name plus initials of other names). The program verifies that the seat is empty then only bookings are done. Passengers are also allowed to check the seats they are booked for by providing the passenger name (first…arrow_forward
- C++arrow_forwardQUESTION 2 An event for a company is designed to bring customers from Kuala Lumpur to a gathering in Kota Bharu, Kelantan. The distance between Kuala Lumpur and Kota Bharu is 450 km. The cost of traveling depends on the type of car chosen by the customer, as shown in Table 1. Write a program that requests the car preference of the customers. Then the program calculates the cost of travelling based on the following formula: Cost = Price per liter/KM per liter × Distance travel The current prices per liter are RM2.05 and RM1.50 for gasoline and diesel, respectively. The liter per KM for each car is provided in Table 1. Table 1 Car Fuel type KM per liter Мyvi Gasoline 25 Perdana Gasoline 19 Triton Diesel 10 Ranger Diesel 15 Ria Gasoline 16 Sample output: Please enter your car type: Triton You choose Triton that uses diesel fuel. The cost is RM120. Please pay RM120 to the front office. Thank you.arrow_forwardprogram - python Write a program that asks the user to enter four test scores. The program should display a letter grade for each score and the average test score. Write the following functions in the program: calc_average—This function should accept five test scores as arguments and return the average of the scores. determine_grade—This function should accept a test score as an argument and display the letter grade for the score within the function, based on the following grading scale: Score Letter Grade 90–100 A 80–89 B 70–7 9 C 60–69 D Below 60 Farrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning