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++: Early Objects (10th Edition)
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_forwardPhython: Create a function so that when giving you a month it tells you the season of that month, for example: if it is January it will be winter.Using the def, try and except ValueError functions.arrow_forward
- Coin Toss Write a function named coinToss that simulates the tossing of a coin. When you call the function, it should generate a random number in the range of 1 through 2. If the random number is 1, the function should display "heads". If the random number is 2, the function should display "tails". Demonstrate the function in a program that sks the user how many times the coin should be tossed and the coin then simulates the tossing of the coin that number of times.arrow_forwardInstructions Write a function create_password() expects two parameters: pet_name (a string) and fav_number (an integer). The function returns a new password generated using the following pattern: fav_number followed by the pet_name followed by the star * and fav_number again (see the example below). Create a program that gets a pet name and a favorite number as input from the user, calls the above function, and then prints the output as shown below. Example Input: Angel 3 Output: Your new password is "3Angel*3". Note that the double quotes are part of the output. The assert in the provided template is checking that this function call is returning the correct value (i.e., a correctly-formed string). assert create_password("Angel", 3) == "3Angel*3" Hints Remember that you cannot directly concatenate an integer and a string - you need to convert an integer into a string using either str() or by using f-strings. Troubleshooting If you are getting AssertionError make sure that your…arrow_forwardA function may have an unlimited number of return values.arrow_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_forwardWrite a split_check function that returns the amount that each diner must pay to cover the cost of the meal. The function has four parameters: . bill: The amount of the bill. people: The number of diners to split the bill between. tax_percentage: The extra tax percentage to add to the bill. tip_percentage: The extra tip percentage to add to the bill. ● ● The tax or tip percentages are optional and may not be given when calling split_check. Use default parameter values of 0.15 (15%) for tip_percentage, and 0.09 (9%) for tax_percentage. Assume that the tip is calculated from the amount of the bill before tax. Sample output with inputs: 25 2 Cost per diner: $15.50 Sample output with inputs: 100 2 0.075 0.21 Cost per diner: $64.25 Learn how our autograder works 461710.3116374.qx3zqy7 1 # FIXME: Write the split_check function. HINT: Calculate the amount of tip and tax, 2 # add to the bill total, then divide by the number of diners. 3 4 Your solution goes here''' 5 6 bill float(input()) 7…arrow_forwardprintTodaysDate is a function that accepts no parameters and returns no value. Write a statement that calls printTodaysDate.arrow_forward
- Future 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_forward//The function must return the value indicated in the comments // The calcDiscountPrice function accepts an item's price and // the discount percentage as arguments. It uses those // values to calculate and return the discounted price. Function Real calcDiscountPrice (Realsprice, Real percentage) // Calculate the discount. Declare Real discount = price * percentage // Subtract the discount from the price. Declare Real discountPrice = price discount // Return the discount price. Return End Functionarrow_forward7.Celsius Temperature Table //write code under void challenge and create function The formula for converting a temperature from Fahrenheit to Celsius is C=59(F−32)C=59(F-32) where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.\ my code below please adust and use chapter 1- 6 terminology //use only chapter 1-6 terminology!!// must validate input using do while loop examle line 98 - 108// //call functions and follow the challenge instructions//Description: Assignment6 C++ Chapter 6 #include <iostream>#include <string>#include <iomanip>#include <fstream>using namespace std; // Function prototypesint menuOption(); double getSales(string…arrow_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