Question: 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
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 iavautil Scanner public class Q3 \{ public static void main(String[] aggs) \{ Scanner console= new Scanner(System in); int option; double amount, balance = 23500.0; Sustem out. priviln("1: Withdrawaln2: Depositin3: Check balance "); Sxsteon outrnint("Please enter you selection (1,2, or 3): "); option-consolenextlotO; if (option =1) \{ System. oathaintlo ("Enter amount to withdraw: "); amount=consolenexiDouble0; balance - amount; Sxstem out,orintln( "Your balance is: " + balance ); } else if (option - 2) i System out.pripting ("Enter amount to deposit: "); amount -consolenextRoublec; balance ta amount; System-out priothn( "Your balance is: " + balance ); I else if (option =3 ) System out orintin( "Your balance is: " + balance); else System out orinth("Remove card ")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
