1. Member
Join Date
Oct 2008
Posts
13
Rep Power
0

## bracket confusion...?

import java.util.Scanner;
import java.text.DecimalFormat;

public class CsCard
{
public static void main ( String [ ] args )
{
DecimalFormat decimalPattern = new DecimalFormat(" ####0.00" );

double prevBalance; //previous balance
double charges; //new charges this month

Scanner scan = new Scanner(System.in);

System.out.println( " Welcome to CS Card International's Account Statement Calculator. \n");

prevBalance = scan.nextDouble( );
charges = scan.nextDouble( );

double total = ( prevBalance + charges);
double interest = 0.20 * (total);//interest rate is 20%
double interest2 = 0.02 * (total);//interest rate is 2% for certain amounts
double balance = (total + interest);
double balance2 = (total + interest2);
double minimum = (0.20 * balance);
double nothing = 0.00;//need this to fill in gap left by interest
double owed = ( balance - 50.00);//remaining balance owed
double owed2 = ( balance2 - 50.00);//remaining balance owed with 2% interest
double minPay = (0.20 * balance2);

if ( prevBalance == 0 && charges <= 50 )
{
System.out.println( " CS CARD International Statement ");
System.out.println( " ============goofy============== ");
System.out.println( " Previous Balance: \$ " + decimalPattern.format(nothing));
System.out.println( " Additional Charges: \$ " + decimalPattern.format(charges));
System.out.println( " Interest: \$ " + decimalPattern.format(nothing));
System.out.println( " New Balance: \$ " + decimalPattern.format(charges));
System.out.println( " Minimum Payment Due: \$ " + decimalPattern.format(charges));
}

else

if ( prevBalance > 0 && total <= 300)
{
System.out.println( " CS CARD International Statement ");
System.out.println( " =========blablabla============= ");
System.out.println( " Previous Balance: \$ " + decimalPattern.format(prevBalance));
System.out.println( " Additional Charges: \$ " + decimalPattern.format(charges));
System.out.println( " Interest: \$ " + decimalPattern.format(interest2));
System.out.println( " New Balance: \$ " + decimalPattern.format(balance2));
System.out.println( " Minimum Payment Due: \$ 50.00 " );
System.out.println( " Remaining Balance Owed: \$ " + decimalPattern.format(owed2));
}

else

if ( prevBalance >= 0 && total >= 350)
{
System.out.println( " CS CARD International Statement ");
System.out.println( " ========hahahahaha============= ");
System.out.println( " Previous Balance: \$ " + decimalPattern.format(prevBalance));
System.out.println( " Additional Charges: \$ " + decimalPattern.format(charges));
System.out.println( " Interest: \$ " + decimalPattern.format(interest2));
System.out.println( " New Balance: \$ " + decimalPattern.format(balance2));
System.out.println( " Minimum Payment Due: \$ "+ decimalPattern.format(minPay));
System.out.println( " Remaining Balance Owed:\$ " + decimalPattern.format(owed));
}
}
}
}

4 errors found:
File: E:\CsCard.java [line: 75]
Error: E:\CsCard.java:75: class, interface, or enum expected
File: E:\Factorials.java [line: 16]
Error: E:\Factorials.java:16: 'else' without 'if'
File: E:\Factorials.java [line: 20]
Error: E:\Factorials.java:20: ';' expected
File: E:\Factorials.java [line: 26]
Error: E:\Factorials.java:26: reached end of file while parsing

2. Member
Join Date
Oct 2008
Posts
13
Rep Power
0
I don't understand how to correct this..

3. I already give a solution to you, work on with that. Sorry I have to close this thread. Ask all your question on the other one.

4. Member
Join Date
Oct 2008
Posts
13
Rep Power
0
Wait how did I post multiple times....?:eek:

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•