Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone help me with building an app in JAVA? Info. explaining everything will be attach below. Thumbs up and positive feedback will be given
Can anyone help me with building an app in JAVA? Info. explaining everything will be attach below. Thumbs up and positive feedback will be given if answered right. I hope someone can help. Cheers!
--------------------------------------------------------
Instructions Each method must also have a comment that indicates the purpose of the method and, if applicable, the purpose of all parameters and return value. Additional in-line comments must be used to explain complex algorithms or unique solutions to the problem. Exercise A Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors will be used as keys, and the predefined color objects will be used as values. Place this class in a package that can be imported into any Java program. Use your new class in a GUI application that allows the user to select one of the colors from a JList. The JList should receive its values from the HashMap programmatically. When the user clicks a button, the application must change the background color of a JPanel to the currently selected color in the JList. Exercise B 1. Create an Invoice class with 4 attributes: Part Number (type int), PartDescription (type String), Quantity (type int), and Price (type double). 2. Create a constructor that allows you to initialize all 4 attributes from values passed in as parameters. 3. Override the toString() method to display all 4 attributes in a format of your choosing. 4. Create a List of 10 Invoices containing data of your choosing. 5. Use lambdas and streams to perform the following queries on the list of Invoice objects and display the results: a. Sort the Invoice objects by PartDescription, then display the results. b. Sort the Invoice objects by Price, then display the results. c. Map each Invoice to its PartDescription and Quantity, sort the results by Quantity, then display the results. d. Map each Invoice to its PartDescription and the value of the Invoice (i.e., Quantity * Price). Order the results by Invoice value. e. Modify Part (d) above to select the Invoice values in the range of $200 to $500 (inclusive) and display the results separately. Instructions Each method must also have a comment that indicates the purpose of the method and, if applicable, the purpose of all parameters and return value. Additional in-line comments must be used to explain complex algorithms or unique solutions to the problem. Exercise A Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors will be used as keys, and the predefined color objects will be used as values. Place this class in a package that can be imported into any Java program. Use your new class in a GUI application that allows the user to select one of the colors from a JList. The JList should receive its values from the HashMap programmatically. When the user clicks a button, the application must change the background color of a JPanel to the currently selected color in the JList. Exercise B 1. Create an Invoice class with 4 attributes: Part Number (type int), PartDescription (type String), Quantity (type int), and Price (type double). 2. Create a constructor that allows you to initialize all 4 attributes from values passed in as parameters. 3. Override the toString() method to display all 4 attributes in a format of your choosing. 4. Create a List of 10 Invoices containing data of your choosing. 5. Use lambdas and streams to perform the following queries on the list of Invoice objects and display the results: a. Sort the Invoice objects by PartDescription, then display the results. b. Sort the Invoice objects by Price, then display the results. c. Map each Invoice to its PartDescription and Quantity, sort the results by Quantity, then display the results. d. Map each Invoice to its PartDescription and the value of the Invoice (i.e., Quantity * Price). Order the results by Invoice value. e. Modify Part (d) above to select the Invoice values in the range of $200 to $500 (inclusive) and display the results separately
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started