Use Java language to program the small application for a hardware store. You will create a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Use Java language to program the small application for a hardware store. You will create a meaningful utility that implements (i) a simple mathematical model for the real problem; (!!) (!!!) design of the application logic; basic user interface. Assume that the hardware store's inventory has products of three types: Products of type X have a strong demand all year round. The price does not depend on season or quantity. Products of type Y have regular prices and special bulky prices. If a customer buys 100 or more units but less than 500, then a 5% discount will apply; 500 or more units but less than 1500-15% discount will apply; 1500 or more units - 25% discount will apply. Products of type Z are seasonable. During the 30-day period starting September 15th of each year, customers can buy 2 units and have the 3rd one for free. Information that your program prints on the screen depends on the type of the product: for the X-product, the output is the price multiplied by the number of units. for the Y-product, the output depends on the number of requested units. - If the number is less than 100, the output is the price multiplied by the number of units and promotional information if the amount is between 100 and 499, between 500 and 1499, and more than 1500. - If the number is more than 100 but less than 500, the output is the discounted price multiplied by the number of units and promotional information if the amount is between 500 and 1499, and more than 1500. -If the number is more than 500 but less than 1500, the output is the discounted price multiplied by the number of units and promotional information if the amount is 1500 or more. - If the number is more than 1500, the output is the discounted price multiplied by the number of units. for the Z-product, the output is -the regular price multiplied by the number of units outside of the promotional period -or the calculated total during the promotional period. Make sure you understand the calculation during the sale; for example, 10 items with the regular price of $2 will cost $14 during the season sale (recall integer division). Create three methods to handle different product types and use switch or if-else-if to call the correct one. After the program can produce the correct result for each product type, create an inventory of 6-10 products of different types. You can hardcode them again but store the inventory in the array of products. Create a method that prints a menu with the and asks the user to choose a product. The menu must show regular prices. Now your program must produce the result according to the user's choice, requested amount, and the date (for type Z). For the date input, make the integer numbers 1-12 for a month, 1-31 for a day, 2021-2050 for a year. Program requirements (i) The program must run until the user decides to quit. (!!!) (!!) Example: Your project must have two Java files, including one with the method main. Product class must have variables (properties) and corresponding setters and getters, though you may not use them in this project. (iv) Product class must have a method that outputs the price in the form of "... dollars... cents." Rounding to the cents must be programmed explicitly. The inventory: 1 Light Bulb 60W 2 Light Bulb 100W 3 Bolt M5 4 Bolt M8 5 Hose 25 feet 6 Hose 50 feet Your choice? 4 Number of units: 1000 3 dollars 0 cents 5 dollars 99 cents. 0 dollars 15 cents: Y XXXXNN 0 dollars 25 cents 10 dollars 0 cents. 15 dollars 0 cents. Y Z Z If you buy more than 1500 units, you will pay $187.50 per unit. The total is $212.50 The inventory: 1 Light Bulb 60W 2 Light Bulb 100W 3 Bolt M5 4 Bolt M8 5 Hose 25 feet 6 Hose 50 feet Your choice? 6 3 dollars 0 cents. 5 dollars 99 cents. 0 dollars 15 cents 0 dollars 25 cents. 10 dollars 0 cents. 15 dollars 0 cents Y XXXXNN Y Z Z Number of units: 10. When do you plan your purchase? Month of purchase (mm): 10 Day of purchase (dd): 1 Year of purchase (yyyy): 2023 The total is $105.00 | Use Java language to program the small application for a hardware store. You will create a meaningful utility that implements (i) a simple mathematical model for the real problem; (!!) (!!!) design of the application logic; basic user interface. Assume that the hardware store's inventory has products of three types: Products of type X have a strong demand all year round. The price does not depend on season or quantity. Products of type Y have regular prices and special bulky prices. If a customer buys 100 or more units but less than 500, then a 5% discount will apply; 500 or more units but less than 1500-15% discount will apply; 1500 or more units - 25% discount will apply. Products of type Z are seasonable. During the 30-day period starting September 15th of each year, customers can buy 2 units and have the 3rd one for free. Information that your program prints on the screen depends on the type of the product: for the X-product, the output is the price multiplied by the number of units. for the Y-product, the output depends on the number of requested units. - If the number is less than 100, the output is the price multiplied by the number of units and promotional information if the amount is between 100 and 499, between 500 and 1499, and more than 1500. - If the number is more than 100 but less than 500, the output is the discounted price multiplied by the number of units and promotional information if the amount is between 500 and 1499, and more than 1500. -If the number is more than 500 but less than 1500, the output is the discounted price multiplied by the number of units and promotional information if the amount is 1500 or more. - If the number is more than 1500, the output is the discounted price multiplied by the number of units. for the Z-product, the output is -the regular price multiplied by the number of units outside of the promotional period -or the calculated total during the promotional period. Make sure you understand the calculation during the sale; for example, 10 items with the regular price of $2 will cost $14 during the season sale (recall integer division). Create three methods to handle different product types and use switch or if-else-if to call the correct one. After the program can produce the correct result for each product type, create an inventory of 6-10 products of different types. You can hardcode them again but store the inventory in the array of products. Create a method that prints a menu with the and asks the user to choose a product. The menu must show regular prices. Now your program must produce the result according to the user's choice, requested amount, and the date (for type Z). For the date input, make the integer numbers 1-12 for a month, 1-31 for a day, 2021-2050 for a year. Program requirements (i) The program must run until the user decides to quit. (!!!) (!!) Example: Your project must have two Java files, including one with the method main. Product class must have variables (properties) and corresponding setters and getters, though you may not use them in this project. (iv) Product class must have a method that outputs the price in the form of "... dollars... cents." Rounding to the cents must be programmed explicitly. The inventory: 1 Light Bulb 60W 2 Light Bulb 100W 3 Bolt M5 4 Bolt M8 5 Hose 25 feet 6 Hose 50 feet Your choice? 4 Number of units: 1000 3 dollars 0 cents 5 dollars 99 cents. 0 dollars 15 cents: Y XXXXNN 0 dollars 25 cents 10 dollars 0 cents. 15 dollars 0 cents. Y Z Z If you buy more than 1500 units, you will pay $187.50 per unit. The total is $212.50 The inventory: 1 Light Bulb 60W 2 Light Bulb 100W 3 Bolt M5 4 Bolt M8 5 Hose 25 feet 6 Hose 50 feet Your choice? 6 3 dollars 0 cents. 5 dollars 99 cents. 0 dollars 15 cents 0 dollars 25 cents. 10 dollars 0 cents. 15 dollars 0 cents Y XXXXNN Y Z Z Number of units: 10. When do you plan your purchase? Month of purchase (mm): 10 Day of purchase (dd): 1 Year of purchase (yyyy): 2023 The total is $105.00 |
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner class Product private String name private double price private double discountedPrice private int discountThreshold1 private in... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
What type of business and industry is Fourevr Enterprises? What products or services do Fourevr Enterprises deliver?
-
Select the right answer (only one answer is possible, unless otherwise indicated). Bookkeeping is a subset of . . . (a) Management accounting (b) Financial accounting (c) Auditing (d) None of these
-
In the same study described in Exercise 8.19, the sodium content was also measured for the sampled hamburgers, and the sample mean and standard deviation were 658 and 47 milligrams, respectively....
-
How did the COVID-19 pandemic expose social divisions?
-
Matthews Bowling Alleys adjusted trial balance as of December 31, 2016, is presented below: Requirements 1. Prepare the closing entries for Matthews Bowling Alley. 2. Prepare a post-closing trial...
-
Prepare a horizontal analysis of the balance sheet data for Nike, using 2026 as a base. (Show the amount of increase or decrease as well.) (Enter amounts in millions. Enter negative amounts and...
-
Prepare a statement of cash flows for Clancy's Dog Biscuit Corporation.
-
A transaction database contains ten transactions as shown below: TID Items bought 1 {s, u, e} 2 {e, r, i, c} 3 {s, a, m, u, e, l} 6 8 9 10 {s, o, p, h, i, a} {e, r, i, c} {n, i, c, k} {p, a, t, r, i,...
-
Please check if this assignment is correct. If it is not, please help me with the solution. 3 Milestone Two - Contribution Margin Analysis 4 2 56 8 Sales Price per Unit 9 Variable Cost per Unit 11...
-
1-(15 points). Reference to the figure below, there are three situations in which two charged particles are fixed in place on an axis. Take distance between two charges = 0.7500m and q = 7.00 C In...
-
The plane below is moving in a circle of radius R. Draw a force diagram for the plane and write force equations.
-
t 1. (40 points) For the next exercise I use quarterly values of the U.S. Treasury Bills (logs) from 1960:1 to 1991:4. ACF 1.4 1.8 2.2 2.6 1.0 0.6 0.2 -0.2 1960 5 1965 10 Lag 15 1970 20 logr10 1975...
-
Write a paper on the following policy: The formal name of the social policy being discussed, and a discussion of the goals of the policy, including a description of the policys target population. The...
-
Use the information given about the angles and to find the exact value of: (a) sin( + ) (b) cos( + ) (c) sin( - ) (d) tan ( + ) (e) sin(2) (f) cos (2) (g) sin /2 (h) cos/2 cos = 4/5, 0 < < /2; cos =...
-
There is a vent with an area 0.4 m2 on the wall of the air supply duct. Try to find the average velocity v of the outlet flow.
-
How do differences in income levels and income distribution among countries affect international businesses?
-
Describe the U.S. role in the world economy.
Study smarter with the SolutionInn App