(Java) - You are required to add comments to your code showing the different stages

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

(Java) - You are required to add comments to your code showing the different stages

Post by answerhappygod »

(Java)
- You are required to add comments to your code showing the
different stages
Java You Are Required To Add Comments To Your Code Showing The Different Stages 1
Java You Are Required To Add Comments To Your Code Showing The Different Stages 1 (242.39 KiB) Viewed 71 times
Q1 ( 2.5 Marks ) Write a Java program to convert and display the contents of a two-dimensional array. The array data type must be integer. The array has the following data: arrayInteger = {{0, 1, 0},{1, 1, 0}} The program should search through the array and do the followings: 1. when it finds 0, then it should display " NO it is wrong", 2. When it finds 1, then it should display " YES it is right ". " The program must display the statements associated with each element, keeping in mind the output format should be two dimensional similar to that of the original array. Q2 ( 2.5 marks ) Write a java program to create prices of Shopping Cart items that provides a menu: 1: Create a new price for each item in the Cart list 2: Print the price of a particular item 0: Exit Enter your choice: The program should do the followings: 1. Define an array of size 10 elements: Shopping Cart which stores prices of items. 2. Define another array of size 10 elements: ItemsNames of the same size that stores names of items. 3. Create a method that displays the menu to give the user the possibility to use the menu as much as he/she wants 4. When the user select option 1, a. the program call a method that creates a new price for each item in the array. b. In the method you need to use random numbers between 1 and 1000 AED exclusive. 5. When user select option 2, a. the program call a method that prints the name of the requested item and its price. PS: Use do.....while loop along with switch statement to choose the appropriate menu options, and to allow the user to repeat the process.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply