Results 1 to 3 of 3
Thread: Homework Help
- 11-29-2012, 03:45 AM #1
Member
- Join Date
- Nov 2012
- Posts
- 4
- Rep Power
- 0
Homework Help
A bank in your town updates its customers’ accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customer’s balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows:
a. Savings accounts receive 4% interest.
b. Checking accounts with balances of up to $5000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%.
I need to write a Java program using Eclipse Indigo that reads a customer’s account number ( int type ), account type ( char type; s or S for savings, c or C for checking), minimum balance that the account should maintain, and current balance. The program should then output the account number, account type, current balance, and new balance or an appropriate error message. Test your program by running it five times, using the following data:
46728 S 1000 2700
87324 C 1500 7689
79873 S 1000 800
89832 C 2000 3000
98322 C 1000 750
This is what I have so far
import java.util.*;
public class Prog_Exercise12
{
static Scanner console = new Scanner(System.in);
{
public static void main(String[] args)
{
int accountNumber;
char acctType;
float acctBalance;
double minimumBalance;
double interest;
System.out.print("Enter the account " + "number: ");
accountNumber = console.nextInt();
System.out.println();
System.out.print("Enter the account type: " + "type: ");
accountType = console.next().charAT (0);
System.out.println();
- 11-29-2012, 04:38 AM #2
Senior Member
- Join Date
- Nov 2012
- Posts
- 105
- Rep Power
- 0
Re: Homework Help
Well I suggest making a new class for Savings accounts and Checking accounts class with the required methods, that way you can do savingsAccount s = new savingsAccount(46728, 1000, 2700);
- 11-29-2012, 05:19 AM #3
Re: Homework Help
Forum Rules -- particularly the third paragraph
Guide For New Members
BB Code List - Java Programming Forum
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Homework Help
By EZ-Ed in forum New To JavaReplies: 3Last Post: 04-10-2012, 07:11 PM -
Homework Help please!
By ghjk in forum New To JavaReplies: 5Last Post: 03-19-2012, 02:44 AM -
Need help with homework
By bkim33 in forum New To JavaReplies: 9Last Post: 02-11-2011, 04:50 AM -
Homework help
By rclausing in forum New To JavaReplies: 26Last Post: 11-24-2009, 06:06 AM -
Please Help with Homework
By theuser in forum Advanced JavaReplies: 2Last Post: 07-30-2009, 03:37 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks