stoyanoff

Account

Jul 4th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.io.IOException;
  4. import java.util.Scanner;
  5.  
  6. public class Account extends json {
  7.  
  8.     Scanner myScan = new Scanner(System.in);
  9.     private double balance;
  10.     private double newBalance;
  11.     private double addBalance;
  12.  
  13.  
  14.     public Account() {
  15.  
  16.     }
  17.  
  18.     public double getBalance() {
  19.         balance = getBalanceJson();
  20.         getBalanceJson();
  21.  
  22.         return balance;
  23.     }
  24.  
  25.     public double setBalance() throws IOException {
  26.         System.out.printf("Please Enter the Deposit Amount: ");
  27.         addBalance = Double.parseDouble(myScan.nextLine());
  28.         newBalance = balance + addBalance;
  29.         return newBalance;
  30.     }
  31.  
  32.  
  33. }
Add Comment
Please, Sign In to add comment