Page 1 of 1

1. Write a Java program to display the contents of a two-dimensional array. The array data type must be integer. Here is

Posted: Sat Nov 27, 2021 10:33 am
by answerhappygod
1 Write A Java Program To Display The Contents Of A Two Dimensional Array The Array Data Type Must Be Integer Here Is 1
1 Write A Java Program To Display The Contents Of A Two Dimensional Array The Array Data Type Must Be Integer Here Is 1 (55.1 KiB) Viewed 64 times
1. Write a Java program to display the contents of a two-dimensional array. The array data type must be integer. Here is the arrayInteger = {{0, 1,0},{1, 1,0}} When the program finds 0, it outputs " Sorry! it is wrong", when it finds 1, it outputs " Yeah! it is right ". The program displays the information in the same location as its origin element. 2 Write a java program to test the price of Shopping Cart items that provides a menu: 1: Create a new price for each item in the Cart list 2: Print the prices list 0: Exit Enter your choice: When the user presses 1, the program call a method that creates a new price for each item in the Cart list using an array and fills the items with random number between 1 and 1000 AED (not inclusive) If the user presses 2, the program call a method that fills the items with random number between 1 and 1000 and prints them in front of their indices. Use switch case for choosing among the menu options. Make a method to display the menu and give the user the possibility to use the menu as much as he/she wants. Make two java files: one for the creating and printing methods and the other one for testing them, which contains the main() method.