Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Exercise#2: (DO IT BY HAND) What is the output of the following program for: a) option =3 b) option =1, amount =700 c) option

java
image text in transcribed
Exercise\#2: (DO IT BY HAND) What is the output of the following program for: a) option =3 b) option =1, amount =700 c) option =2, amount =850 package lab2; import javautilscanner: public class Q3 \{ public static void main(String] args) \{ Scanner console= new Scanner(System in); int option; double amount, balance =23500.0; Systerwout println("1: Withdrawalln2: Depositn3: Check balance "); Systewourout,print " "Please enter you selection (1,2, or 3) : "); option=sensolenextint0; if ( option =1) \{ Systew, out printlo(" "Enter amount to withdraw: "); amount = sonsole ncx tDoubleO; balance = amount; Syaterm. out println(" "Your balance is: " + balance )i } else if (option =2 ) \{ System, out printlo("."Enter amount to deposit: "); amount-sensols nextDouble0; balance += amount; System,out,println("Your balance is: " + balance); ) else if (option =3 ) Systemout,printla(" "Your balance is: " + balance ); else System out, println("Remove card ")

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_2

Step: 3

blur-text-image_3

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 Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

Distinguish the three measures used in marketing research.

Answered: 1 week ago

Question

7-16 Compare Web 2.0 and Web 3.0.

Answered: 1 week ago