3 Replies - 2263 Views - Last Post: 12 May 2009 - 09:28 PM Rate Topic: -----

#1 abpunisher901  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 03-May 09

Checking Account

Post icon  Posted 03 May 2009 - 03:10 PM

Write a program to help a user keep track of their checking account balance. The program will allow the user to process two types of bank transactions: deposits and withdrawals. The program will keep track of a userís beginning bank balance, current bank balance, the total deposits they have made, and the total withdrawals they have made. You may use the Scanner class or Dialog Boxes to get the userís input. If you are unsure on Dialog Boxes use the Scanner class. Donít forget to format your output using the DecimalFormat class and/or printf.

This post has been edited by abpunisher901: 03 May 2009 - 03:11 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Checking Account

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8334
  • View blog
  • Posts: 31,858
  • Joined: 06-March 08

Re: Checking Account

Posted 03 May 2009 - 03:48 PM

May be you are in the wrong forum.

We won't do your homework... but we are ready to help you if you show some efforts

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 abpunisher901  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 03-May 09

Re: Checking Account

Posted 12 May 2009 - 09:12 PM

View Postpbl, on 3 May, 2009 - 02:48 PM, said:

May be you are in the wrong forum.

We won't do your homework... but we are ready to help you if you show some efforts

well i start on it and here what i got so far and im trying my hardest

[rules][/rules]

import java.util.
import java.io.
import java.text

public class CheckingAccount
{
	public static void main(String[] args) 
	{
		double accumulator = 0.0;
		double TotalWithdrawal = 0.0;
		String = "Deposits.txt";
		String = "Withdrawals.txt";
		NumberFormat cf = NumberFormat.getCurrencyInstance();

		CheckingAccount account = new CheckingAccount();

	
		Scanner input = new Scanner(file1);



Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8334
  • View blog
  • Posts: 31,858
  • Joined: 06-March 08

Re: Checking Account

Posted 12 May 2009 - 09:28 PM

This is a start...
The amounts should be in the class as instance variables becvause they are part of the checking account
What is in the main method is just the scanner to test your CheckingAccount class

The 2 String needs a name
What are the 2 string.txt files 2 read where there are some transactions ? And file1 that use use for your scanner ?

public class CheckingAccount
{
	double accumulator;
	double TotalWithdrawal;

	 // Constructor empty for now but that may change
	 CheckingAccount() {
	 }

	public static void main(String[] args) 
	{
		String depositFile = "Deposits.txt";
		String withdrawFile = "Withdrawals.txt";
		NumberFormat cf = NumberFormat.getCurrencyInstance();

		CheckingAccount account = new CheckingAccount();
		Scanner input = new Scanner(file1);



Now if you want to read a file you will have to say that it is a file, Scanner by defaut reads a String

Scanner input = new Scanner(new File(deposit));

Happy coding
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1