Write a program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice costs $2.5, but the price varies with the amount that he purchases. The following table shows the discount that Jacob receives.
Order Volume |
Discount Rate |
>= 200 bags |
25% off |
120 - 199 bags |
20% off |
60 - 119 bags |
15% off |
40 -59 bags |
10% off |
20 – 39 bags |
5.5% off |
0-19 bags |
No discount |
-
(1) Inyourprogram,definevariableswithmeaningfulnamestoacceptuserinputonordervolume, and calculate total ordering cost based on the order volume inputted. Use if-else statements to handle the calculations for different order volumes as shown in the above table.
-
(2) Yourprogramshouldprintoutuserordervolume,discountrate,andtotalorderingcostinconsole (similar to the following sample outputs)
Step by stepSolved in 4 steps with 4 images
- JAVA based program need helparrow_forwardBMI is a measure of body condition and it is related to a person's weight and height. In the metric system, for weight given in Kilograms (Kg) and height given in centimeters (cm), the BMI value is given by: $BMI=10000*weight/(height^2)$. The person's condition is given by the table below:\n", "\n", "| BMI | Condition|\n", "|-----|----------|\n", "| <18.5| Underweight|\n", "|>=18.5 and <25| Normal |\n", "|>=25 and <30| Overweight |\n", "|>= 30 | Obese|\n", "\n", Write a program that asks for a person's height in cm and weight in Kg and print's the person's condition.arrow_forwardpython3 problemarrow_forward
- Loop through the animalList created in a previous question and print the total time taken and total time given for each animal. Example output: Zirly the Zebra - Time taken for all behaviors: 890 minutes of 1000 Henry the Hawk - Time taken for all behaviors: 350 minues of 1000 Choose one of the following from the above choices (A, B, C or D within the code):// Assume the following variables exist: Behavior[] someBehaviors = // Omitted for brevity Animal zirly = Animal("Zirly the Zebra", 812.3, someBehaviors); Animal henry = Animal("Henry the Hawk", 35.5, someBehaviors); Animal[] animalList = new Animal[]{ zirly, henry }; // --------------------------- // A for(int i = animalList.length; i < animalList.length; i++) { Animal tempAnimal = animalList[i]; int timeTakenSum = 0; int timeGivenSum = 0; for(j = 0; j < tempAnimal.getBehaviorList().length; j++) { Behavior tempBehavior = tempAnimal.getBehaviorList()[j]; timeTakenSum +=…arrow_forwardInstallation of a Shopee Billboard Max. score: 100 You are installing a billboard and want it to be at the maximum height. The billboard will have two steel supports, one on each side. The height of each steel bracket must be equal. You have a number of rebar rods that can be welded together. For example, if the bars are of length 1, 2, and 3, they can be welded together to form a length of 6 brackets. Return the maximum possible installation height of the billboard. Return 0 if the billboard cannot be installed.arrow_forwardPrompt Problem: A company wants a program that will calculate the weekly paycheck for an employee based on how many hours they worked. For this company, an employee earns $20 an hour for the first 40 hours that they work. The employee earns overtime, $30 an hour, for each hour they work above 40 hours. Example: If an employee works 60 hours in a week, they would earn $20/hr for the first 40 hours. Then they would earn $30/hr for the 20 hours they worked overtime. Therefore, they earned: ($20/hr 40hrs)+($30/hr 20 hrs) $800+ $600 = $1400 total. For this assignment, you must create pseudocode and a flowchart to design a program that will calculate an employee's weekly paycheck. - Write pseudocode to design a programming solution by outlining a series of steps and using appropriate indentation and keywords. As you write your pseudocode, be sure to consider the following: What input does the computer need? What steps does the program need to follow to process the input? What output should…arrow_forward
- Suppose you are a computer salesman and your income depend on the total sales and commissions earned for the computers that you sell. Commission rates vary depending on how many units you sold (see chart below). Your income equals to the total sales plus the commission where the commission equals to total sales times the commission rate. That is, commission = total sales * commission rate and income = total sales + commission. Total Sales Commission rate % Less than 200 sold 8% (totalsales < 200) Greater or equal to 200 sold 10% (totalsales >=200 & totalsales <400) Greater than to 400 sold 12% (if (totalsales >= 400) Use Multiway if, else if (use as many you need) and else correctly Review slides 3-CH-2 Slide 4 and 8 Write the code correctly as show in the chapter slides. Pay attention to the commission chart above: (3) input as examples shown 500, 250, 150 You can work with your team and submit your code and output in PDF. 1. Provide the user the commission rate list…arrow_forwardA rod is used to hang a load (force) of 1000 N.There are 4 ingredients with their respective strengths.Create a program to create a bar diameter table, if using the 4 materials.Example: Copper Steel Material. Aluminum. Bronze Strength(N/mm2) 2000. 1600. 1400. 1700Rod Diameter: Ingredient. Copper Steel. Aluminum. BronzeDiameter. (mm) …. …. …. …..Note: Strength is the maximum stress the material can withstandStress S = force/sectional area S=force/A A = force/SmaxCross-sectional area A = 3.14 x d2 /4 d = root(4xA/3.14)Instructions: Make a list to store the ingredient names and strengths Create in a python programarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education