Java code for "Withdraw Money " in the bank taking User Userinput (Scanner)

Java code for "Withdraw Money " in the bank taking User Userinput (Scanner)

Write A Java Code " Withdraw Money " In The Bank. User User Input ( Scanner)

Ans:

import java.util.Scanner;

public class BankAccount{

public static void main(String [ ] args){

Scanner reader = new Scanner(System.in);


 double name;

 double balance;

 double deposit;

 double withdrawl;

 double bankaccount;

 double UserInput;

 double EnterFunds;


 System.out.println("Welcome to your bank account!");

 bankaccount = reader.nextDouble();

 System.out.println("Please enter your name.");

 System.out.println("Please enter 1 to deposit funds or 2 to withdraw funds.");

 UserInput = reader.nextDouble();


 if(UserInput == "1"){

 System.out.println("How much would you like to deposit.)"

 deposit = reader.nextDouble();

 }

 else if(UserInput == "2"){

 System.out.println("How much would you like to withdrawl?");

 withdrawl=reader.nextDouble();

 }

إرسال تعليق

أحدث أقدم