Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 (Marks: 40) Design a Java application that will capture three (3) different mobile devices. The device details must be stored in parallel arrays

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Question 5 (Marks: 40) Design a Java application that will capture three (3) different mobile devices. The device details must be stored in parallel arrays for the Device ID, Device Name and Device Price. Use the following data as an example when populating the arrays. Device ID Device Name 101 Samsung S8 iPhone 7 Device Price R 15 500.00 R 13 200.00 102 103 Huawei P10 R 10 100.00 Prompt the user with the menu system for adding, searching or displaying the devices. The user must have the option to enter the numbers 1, 2, 3 or zero (0) to exit the application. Make use of JOptionPanes for input and output. Input x ? Enter (1) to add devices. Enter (2) to search for device details. Enter (3) to display all the device details. Enter (0) to exit. OK Cancel If the user enters a one, prompt the user to enter in three device details. Ensure that the user is prompted to enter all three devices as per the data above. input x Input Sample Screen Shot (Device 1 only) x Input ? Please enter the ID for Device 1 ? Please enter the name for Device 101 Samsung S8 Cancel Cancel 1011 ? Please enter the price for device 101 15500 OK Cancel OK OK Create a loadArray() method that will store the device details captured by the user into the three parallel arrays. If the user enters a two provide functionality for a device search. Create a searchArray() method and write the code to enable the user to search for a specific type of device. If the Device ID is found in the array, show the product details. Sample Screen Shot Input ? Enter (1) to add devices. Enter (2) to search for device details. Enter (3) to display all the device details. Enter (0) to exit. 2 OK Cancel Input X ? Enter in the Device ID 102 OK Cancel Display x i PRODUCT ID: 102 PRODUCT: iPhone 7 PRICE: R 13200.0 OK If the Device ID that the user searched for doesn't exist in the array, show a message to indicate that the device cannot be located. Sample Screen Shot Display x The device you entered cannot be found!!! OK If the user enters a three in the menu system display all the device details to the user stored in the parallel arrays. Sample Screen Shot Device Stock Report i ID DEVICE PRICE 101 Samsung S8 R15500.0 102 iPhone 75 R13200.0 103 Huawei P10 R10100.0 DEVICE COUNT:3 OK Implement user friendliness into the application by prompting the user if they would like to add/search more devices. Sample Screen Shot Continue? ? Continue using the application? Yes No Finally if the user enters a zero (0) in the menu system exit the application. Mark Examiner Moderator 8 Save the application as Mobile Device Application.java. Marking Guideline Variables declared and assigned: No variables declared/assigned - O marks Some variables declared/assigned - 4 marks All variables declared/assigned - 8 marks Call of methods: No methods called - O marks Calling of loadArray() method only - 2 marks Calling of searchArray() method and loadArray() method - 4 marks Input and Output: 4 6 8 Some correct - 2 marks per JOptionPane All input and output correct - 6 marks LoadArray Method: LoadArray() method attempted - maximum of 4 marks LoadArray() method used correctly with the population of the parallel arrays - 8 marks. SearchArray Method: SearchArray() method attempted - maximum of 4 marks SearchArray() method used correctly to searched the arrays and display messages shown - 12 marks Save file correctly TOTAL 12 2 40 END OF PAPER

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago