Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a Java program to convert and display the contents of a two-dimensional array. The array data type must

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. 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. Create a method that displays the menu to give the user the possibility to use the menu as much as he/she wants 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.

Step by Step Solution

3.41 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

Q1 Java program to display the contents of a twodimensional array public class TwoDArrayDisplay publ... 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

Organic Chemistry

Authors: Paula Yurkanis Bruice

4th edition

131407481, 978-0131407480

More Books

Students also viewed these Programming questions