You are on page 1of 3

PAMANTASAN NG LUNGSOD NG PASIG

COLLEGE OF COMPUTER STUDIES

Laboratory Exercise 1
Review of Java Programming

Objectives:
At the end of the exercise, the students should be able to:

• Create simple program in Java as a review.


• Apply the different Java commands to solve the given problem.
• Write Java programs using methods.

Activities:
1. 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 of Php 10000 and Php 50000 for savings and checking accounts
respectively. If a customer’s balance falls below the minimum balance, there is a service
charge of Php 100.00 for savings accounts and Php 500.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 3% interest.


b. Checking accounts with balances of up to Php 100000.00 more than the minimum
balance receives 2% interest; otherwise, the interest is 4%.

Write a program that reads a customer’s account number (int type), account type (char
type; s or S for savings, c or C for checking, and treat any other character as an error) and
current balance. The program should then output the account number, account type,
current balance, interest or service charge and the new balance.

Use methods in your program and this should be repeated unless no other input to process.

Sample:

Enter Account No: 12345


Account Type: S
Current Balance: 26750.00

Run Date : Sept 12, 2021

Account No Account Type Current Balance Interest Service Charge New Balance
12345 Saving 26750.00 802.50 27552.50

Try Again? (Y/N) Y


(Note: If the answer here is Y/y, repeat the process, if the answer is N/n terminate the
program. No other characters should be accepted.)

Laboratory Exercise 1 - Set B Page 1 of 3


PAMANTASAN NG LUNGSOD NG PASIG
COLLEGE OF COMPUTER STUDIES

Enter Account No: 22345


Account Type: c
Current Balance: 45620.00

Run Date : Sept 12, 2021

Account No Account Type Current Balance Interest Service Charge New Balance
22345 Checking 45620.00 500.00 45120.00

Try Again? (Y/N) n

Program Terminated

Submission Requirements:
Students must adhere to the following requirements when submitting the laboratory
exercises.

1. Every program should follow this File Header requirement. The first lines of the program
to be submitted should include a comment with the following information and format:

/** * A short description of the program.


* Group # (Replace # with your group number)
* Authors: LastName, FirstName (Leader)
* LastName, FirstName (Members)
* LastName, FirstName
* Laboratory Exercise #
* Date: (date the program was created)
*/

2. Naming Convention
a. Program Name or class name should be named following this notation :
IT2X_Group#_Lab#A/B where X is your section and # is the group and laboratory
exercise # set A/B. For example, if you belong to BSIT-2A, group #1 and this is
laboratory exercise #1 set A, the program name or class name is
IT2A_Group1_Lab1A For BSCS-2A class, use CS2A_Group1_Lab1A

b. For the folder name : 2X-Group#-Lab#A/B and following the example above, the
folder name is 2A-Group1-Lab1A and for BSCS-2A use 2CS-Group1-Lab1A

3. Test your program several times to make sure it is running correctly, and it is the
program you will submit. Only the source program needs to be submitted. Place it in
your folder, compress and submit. The result should be
2A-Group1-Lab1A.zip

Laboratory Exercise 1 - Set B Page 2 of 3


PAMANTASAN NG LUNGSOD NG PASIG
COLLEGE OF COMPUTER STUDIES

4. Submit the zipped file using the “Submission Form – Data Structures” intended for your
class. Link will be sent in your respective GCs. Only one submission per group is
required.

5. Date of submission will be announced in class.

Laboratory Exercise 1 - Set B Page 3 of 3

You might also like