![]() |
![]() |
#1 (permalink) |
Status: Senior Member
Posts: 201
|
![]()
i have done many correction on my java program can you help me with my problem
import java.util.Scanner; public class BankAccount { public static void main(String[] args) { double amount = 0.0; public void deposit(double amount) { if(amount < 0) { double balance = 888.55; balance = balance + amount; } else { System.out.println("insufficient funds"); } } public void withdraw(double amount) { Scanner keyboard = new Scanner(System.in); System.out.println("Enter your name:"); String holder = keyboard.nextLine(); System.out.println("Enter your pin number: "); int pinNumber = keyboard.nextInt(); if(pinNumber < 0) { double balance = 888.55; balance = balance - amount; System.out.println("your amount is " + balance); } else { System.out.println("invalid information"); } } } } |
![]() |
![]() |
![]() |
Bookmarks |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
when i run oracle jdeveloper it make this error Error: Could not create the Java Virtual Machine. Error: A fat? | mahmoudp | Oracle Databases | 1 | 03-10-2013 03:06 PM |
Minecraft increase allocated ram Java error "could not create Java virtual machine error"? | Unknown_User | JavaScript | 0 | 04-08-2012 10:37 AM |
Java Error: hw2.java: 2: error: class, interface, or enum expected? | spontaneous09 | Html Code/ Html Codes | 2 | 02-25-2012 07:07 AM |
Error with java (A fatal error has been detected by the Java Run-time Environment) | cDymnAmone | Code/ codes | 0 | 09-25-2011 12:13 AM |
what does the java error message "Error: java.lang.NoSuchMethodException: ArrayUI.outputPlayer()" mean | FriendCaroline | Programming | 0 | 06-05-2011 12:36 PM |