Write a program that will determine whether a deparment store customer has exceeded the credit limit on a charge account(5000$). The customer gives you his/her account number, he/she has a beginning of the month balance, the program should total all the purchases by the customer for the month, total any credits and display either they are overdrawn or the balance they have remaining in their account.
im in beginner computer programming class :P so no hard stuff thanks! rly need help on this... i thought of doing a loop on the question do you have more purchases? and if they say yes they'll have to enter it, and over until they say no. how do i do that?
import java.io.*;
import java.util.*;
public class CA2
{
public static void main (String args[])
{
Scanner kbReader = new Scanner(System.in);
System.out.print ("Enter your account number: ");
int acctnum = kbReader.nextInt ();
Scanner kb1Reader = new Scanner(System.in);
System.out.print ("Please enter the first purchase you made this month: ");
double p1 = kb1Reader.nextInt ();
double total = ;
double remain = 5000 - total;
if(total<=5000)
{
System.out.println("You have" + remain + "dollars remaining in your account");
}
else
System.out.println("Your account is overdrawn!");
}
}