Write a program using only method and array using java language and you can use only method
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program using only method and array using java language and you can use only method or only array
Transcribed Image Text:
3- Write a program that prompts the user to give the sequence of 3 items. For each given item the program should ask the use to enter the type and the quantity (see the sample run) and calculate and display the subtotal of this item and add it to the total. The program should then compute the discount amount of the bill and the final cost: Total = sum of subtotals of all items Final Cost = Total - discount amount The program should display the Total, the discount amount and the final cost as follow: Sample run 1: 3/4 Enter an item type number: 1 Enter the item quantity: 10 Enter an item type number: 3 Enter the item quantity: 10 Enter an item type number: 2 Enter the item quantity: 5 The Total is: $134.0 The discount amount is: $13.4 The total due cost is: $120.6 3- Write a program that prompts the user to give the sequence of 3 items. For each given item the program should ask the use to enter the type and the quantity (see the sample run) and calculate and display the subtotal of this item and add it to the total. The program should then compute the discount amount of the bill and the final cost: Total = sum of subtotals of all items Final Cost = Total - discount amount The program should display the Total, the discount amount and the final cost as follow: Sample run 1: 3/4 Enter an item type number: 1 Enter the item quantity: 10 Enter an item type number: 3 Enter the item quantity: 10 Enter an item type number: 2 Enter the item quantity: 5 The Total is: $134.0 The discount amount is: $13.4 The total due cost is: $120.6
Expert Answer:
Answer rating: 100% (QA)
import javaio import javautilScanner public class Main Scanner sc new Scanner Syst... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
The Trump administrations tariffs have opened new doors for U.S. commercial rivals in China, a study shows, adding to trade-induced headaches for American businesses. As Beijing has raised duties on...
-
Can you use foreign language wordlists?
-
Can the use of sexually coarse and vulgar language in the workplace constitute sexual harassment?
-
O An hair dryer is basically a duct with a fan that draws cool air from the atmosphere at one end, forces it on an electrical resistor (where the air is heated up) and discharges it at the other end....
-
Refer Exercise 12.73. a. Estimate the mean catch for a lake having residency 5 70, size 5 .8, and structure 5 80 for lakes both with and without access using the second- order model. b. Place 95%...
-
How might the vision of the "3Cs" have helped Sears work through issues such as closing stores, downsizing the number of employees, and selling parts of the business?
-
Wind with a speed of 40 mi/h moves four times as fast as wind with a speed of 10 mi/h. Determine whether the given statement represents a meaningful ratio, so that the ratio level of measurement...
-
Multiple-choice questions: a. Which party has the primary responsibility for the financial statements? 1. Bookkeeper 2. Auditor 3. Management 4. Cost accountant 5. None of the above b. Which of the...
-
The Alpine House, Incorporated, is a large retailer of snow skis. The company assembled the information shown below for the quarter ended March 31: Sales Selling price per pair of skis Variable...
-
create a general journal, general ledger, accounts recievable ledgar, accounts payable ledgar, inventory COGS calculations, trial balance at 12 31 2014, financial statements, post closing trial...
-
An increase in the price of a movie ticket creates an increase in consumer purchasing power so that they can afford to buy more movie tickets. This is called the income effect. * True False -If the...
-
The formal means by which work is coordinated in an organization is called the __________. A. organizational structure B. organizational culture C. organizational dynamic D. none of the above
-
Progressive firms restructure only when firm performance declines. True of False
-
Corporate restructuring can be voluntary or involuntary. True of False
-
In general, a functional structure tends to be most appropriate for differentiated businesses. True of False
-
Horizontal structures have fewer managerial levels than vertical structures. True of False
-
A rod of charge -3.50 nC is bent into a semicircle of radius R = 24.3 cm. A second rod, this one straight of charge +3.50 nC and length 2R, is placed a distance d = 6.10 cm from the semicircle, as...
-
Prove that if Σ an is absolutely convergent, then a. an
-
Write a program that displays a rectangle. You can point the mouse inside the rectangle and drag (i.e., move with mouse pressed) the rectangle wherever the mouse goes. The mouse point becomes the...
-
Write a method to sort a two-dimensional array using the following header: public static void sort(int m[][]) The method performs a primary sort on rows and a secondary sort on columns. For example,...
-
Write a recursive method that converts a decimal number into a hex number as a string. The method header is: public static String dec2Hex(int value) Write a test program that prompts the user to...
-
An ideal classical gas composed of \(N\) particles, each of mass \(m\), is enclosed in a vertical cylinder of height \(L\) placed in a uniform gravitational field (of acceleration \(g\) ) and is in...
-
Show that the quantum-mechanical partition function of a system of \(N\) interacting particles approaches the classical form \[Q_{N}(V, T)=\frac{1}{N ! h^{3 N}} \int e^{-\beta E(\boldsymbol{q},...
-
Show that the entropy of an ideal gas in thermal equilibrium is given by the formula \[ S=k \sum_{\varepsilon}\left[\left\langle n_{\varepsilon}+1ightangle \ln \left\langle...
Study smarter with the SolutionInn App