Question
JAVA A company manufactures 5 different devices and each device is built using a varying amount of 7 different components. Each device and its required
JAVA
A company manufactures 5 different devices and each device is built using a varying amount of 7 different components. Each device and its required amount of components is listed in the table below.
Components | |||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | |
MP3 Player | 9 | 13 | 4 | 7 | 1 | 14 | 10 |
Smart Phone | 8 | 2 | 12 | 11 | 6 | 15 | 2 |
Digital Watch | 9 | 6 | 7 | 10 | 15 | 8 | 3 |
Tablet | 12 | 14 | 8 | 15 | 2 | 7 | 8 |
Portable Gaming System | 12 | 10 | 3 | 11 | 8 | 3 | 5 |
Each component has an individual cost which is listed in the table below.
Components | |||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | |
Cost | $10.75 | $15.27 | $5.98 | $9.67 | $4.32 | $12.50 | $1.42 |
Using the information in the tables, your program will calculate some data about the products.
Populating the Data:
Your program will have three arrays:
A 2D array to store the data of the first table
A 1D array to store the names of each product
A 1D array to store the costs of each component.
Practice getting the data into your program in these ways:
Console input with Scanner
File I/O
Using an Initializer List.
Calculations:
Compute and Display the cost of manufacturing each device.
Compute and Display the Device name with the highest cost.
Compute and Display the Device name with the lowest cost.
Practice other calculations as you see fit, i.e. Average number of components per device, Device with the highest / lowest number of components, etc, etc.
Sample Results:
MP3 Player Cost: $580.39 Smart Phone Cost: $510.93 Digital Watch Cost: $495.99 Tablet Cost: $643.17 Portable Gaming System Cost: $485.17 Highest Cost Device: Tablet Lowest Cost Device: Portable Gaming System
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