Title: Assignment JAVA 412
1Assignment JAVA 4-12
- Section 002
- YooSik Hwang 448-08-1132
2Assignment 4-12 Source
//Exe 4.12 Assignment2.java //Programmed by
YooSik Hwang import javax.swing.JOptionPane pub
lic class Assignment2B public static void
main( String args )
3 int begBalance, totCharge, totCredit,
creditLim, totBalance String accountNumber,
// customer's accountNo. begBalance1,
// balance at the beginning of the month
totCharge1, // total of all item
charged by this customer totCredit1,
// total of all credtits applied to the
customer's account creditLim1 //
allowance of credit limit
4accountNumber JOptionPane.showInputDialog(
"Enter Your Customer Number" ) begBalance1
JOptionPane.showInputDialog("Enter your beginning
balance" ) totCharge1 JOptionPane.showInputDia
log( "Enter Total of all items charged this
month" ) totCredit1 JOptionPane.showInputDialo
g( "Enter Total of all credits applied"
) creditLim1 JOptionPane.showInputDialog(
"Enter Allowed credit limit" )
5//converting string to integer begBalance
Integer.parseInt (begBalance1) totCharge
Integer.parseInt (totCharge1) totCredit
Integer.parseInt (totCredit1) creditLim
Integer.parseInt (creditLim1) //calculation to
tBalance begBalance totCharge - totCredit
6//check the credit limit if(totBalance gt
creditLim) JOptionPane.showMessageDialog(null,
" Your Balance is " "" totBalance "!!" "
Credit limit exceeded") else JOptionPane.show
MessageDialog(null," Your Balance is " ""
totBalance "." " Credit limit not exceeded
yet")
7First Screen Capture of output. Enter the
customer Number.
8Second Screen capture of output Enter the
beginning balance
93rd screen capture of output Enter total of all
items charged this month
104th Screen capture of output Enter Total of all
credits applied
115th Screen capture of output Enter Credit limit
126th Screen capture of output It shows the limit
is whether exceeded or not.
13Flowchart
Get amount Credit applied
Start
Get Credit Limit
Get AcctNo.
Calculate new balance
Get old Balance
Display output
Get Amount Charged
End
14Pseudocode
Input customer account number Input beginning
balance Input the total amount charged Input
total amount credit to account Input credit limit
for account Calculate total balance If total
balance gt credit limit Display credit limit
exceeded Else Display you are OK