Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please) I need the answer quickly, please :((((((.. pleaaasssee heeelp mmmeeee// i

( i need Unique answer, don't copy and paste, please) (dont' use handwriting, please)

I need the answer quickly, please :((((((.. pleaaasssee heeelp mmmeeee// i need all answers, UNIQUE ANSWER please

Q1: Given the BankAccount class in Figure 1:

image text in transcribed

Write a program (the public class) that repeatedly prints a menu and asks user to select one choice to execute as shown in Figure 2.

Show a screenshot of the output (if there is no screenshot of the output, the student shall get a zero mark for this question).

_______________

Q2:

Write a program that stores your ID Number in an array of integers then do the following:

1.Print the array by using for-each loop.

2.Reverse the order of the array by using a loop and an integer variable called temp.

3.Print the array after reverse by using for-each loop.

Show a screenshot of the output (if there is no screenshot of the output, the student shall get a zero mark for this question).

Program typical run:

image text in transcribed

_______________

Q3:

Write a Java program that allows the following:

1.Create an array list of 20 integers. The 20 integers are generated randomly with possible values from 0 to 10.

2.Print the content of the array list.

3.Find how many of these values are multiple of 3.

Show a screenshot of the output with your name and Id in the first line (if there is no screenshot of the output, the student shall get a zero mark for this question).

Program typical run:

Scenario 1

image text in transcribed

Scenario 2

image text in transcribed

The following snipped code can help you to write your program:

image text in transcribed

image text in transcribed

_______________

Q4:

Write a full Java program that:

1.Generate an integer random number between 0 and 6.

2.Then make a loop that keeps asking the user to guess the generated random number. If the user input is not equal to the generated random number, then print, Try again and allow the user to input another guess until the user guess correctly.

3.If the user input is equal to the generated random number, then prints, Good guess. And print how many times did the user guess until he/she guessed correctly.

Show a screenshot of the output (if there is no screenshot of the output, the student shall get a zero mark for this question).

Program typical run:

Scenario 1

image text in transcribed

image text in transcribed

Figure 2 1 D.post; Wichdra Figure 1 1 Deposite class BancAccount doule balance: public wid depositeuble ano nt)(balance-balance4anount;} pcblic void withdra:able anot) | amount -50 1 Depo it Print if la ountilancebalance>01 System.cut.printInl sot valid anountI poblic dcuble getl Iretn balano: Invaiid inpE 1 Deposite Figure 2 1 D.post; Wichdra Figure 1 1 Deposite class BancAccount doule balance: public wid depositeuble ano nt)(balance-balance4anount;} pcblic void withdra:able anot) | amount -50 1 Depo it Print if la ountilancebalance>01 System.cut.printInl sot valid anountI poblic dcuble getl Iretn balano: Invaiid inpE 1 Deposite

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

4. What will the team agreement contain?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago