Assignment JAVA 412 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Assignment JAVA 412

Description:

... allowance of credit limit ... creditLim1 = JOptionPane.showInputDialog( 'Enter Allowed credit limit' ... check the credit limit. if(totBalance creditLim) ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 15
Provided by: yoosik
Category:
Tags: java | assignment

less

Transcript and Presenter's Notes

Title: Assignment JAVA 412


1
Assignment JAVA 4-12
  • Section 002
  • YooSik Hwang 448-08-1132

2
Assignment 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
4
accountNumber 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")
7
First Screen Capture of output. Enter the
customer Number.
8
Second Screen capture of output Enter the
beginning balance
9
3rd screen capture of output Enter total of all
items charged this month
10
4th Screen capture of output Enter Total of all
credits applied
11
5th Screen capture of output Enter Credit limit
12
6th Screen capture of output It shows the limit
is whether exceeded or not.
13
Flowchart
Get amount Credit applied
Start
Get Credit Limit
Get AcctNo.
Calculate new balance
Get old Balance
Display output
Get Amount Charged
End
14
Pseudocode
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
Write a Comment
User Comments (0)
About PowerShow.com