Hey people im just wondering is there a way to store a number without using the non-void methods
heres my code my code works grand but i need to store the balence and by how much it was topped up by if u get me drift
class Rough1{ public static void main(String[] args) { showServiceMenu(); } // Declare Global Variables int input=0; public static void showServiceMenu() { // Local Variables int input=0; String password = "me"; int cardnum = 123; double balence=0; double add=0; double purchase; char option; char stop = 'x'; // Loop to repeat the program until x is entered do{ System.out.println("Login: Press 1"); System.out.println("Customer Details: Press 2"); System.out.println("Customer Balence: Press 3"); System.out.println("Top-Up: Press 4"); System.out.println("Purchase: Press 5"); input = Keyboard.readInt(); if(input==1){ System.out.println("Please enter in your Debit Card number and password "); System.out.println("Debit Card Number: "); cardnum = Keyboard.readInt(); System.out.println("Password: "); password = Keyboard.readString();} if(input==2){ System.out.println("Your Details "); System.out.println("Name: Shane Lowry "); System.out.println("Address: 9 Sheepmoor Ville "); System.out.println("Card Number: 123");} if(input==3){ System.out.println("Your balence is "+balence);} if(input==4){ System.out.println("How much would you like to top-up"); add = Keyboard.readDouble(); if(add <= 100) System.out.println("Your new balence is "+(add+balence)); else System.out.println("Your cannot add more than 100");} if(input==5){ System.out.println("How much would you like to spend?"); purchase = Keyboard.readDouble(); if(purchase>balence){ System.out.println("You don't have enough money to make a purchase");} else if(purchase<=balence){ System.out.println("Thank you, you have made a purchase for "+purchase);} } System.out.println("Do you want to continue?"); option = Keyboard.readChar(); if(option=='x'){ System.out.print("Goodbye");} }while(option!='x'); } }