0% found this document useful (0 votes)
180 views1 page

COMPROG: Computer Fundamentals and Programming: Important!!!

This document provides instructions for two programming assignments. The first is to create a program called Saving.java that calculates weekly savings based on allowance and average daily expenses. The second is to create a program called Purchase.java that calculates change owed from a 100 peso bill based on an amount purchased less than 100 pesos, breaking down the change into denominations. It also provides sample outputs and reminds the reader how to set up a new Java file and where to save it.

Uploaded by

Caps Lock
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views1 page

COMPROG: Computer Fundamentals and Programming: Important!!!

This document provides instructions for two programming assignments. The first is to create a program called Saving.java that calculates weekly savings based on allowance and average daily expenses. The second is to create a program called Purchase.java that calculates change owed from a 100 peso bill based on an amount purchased less than 100 pesos, breaking down the change into denominations. It also provides sample outputs and reminds the reader how to set up a new Java file and where to save it.

Uploaded by

Caps Lock
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

COMPROG: Computer Fundamentals and Programming Laboratory Activity 03

So far, you are already familiar with the following:


 Opening and editing an existing Java file using the JCreator IDE
 Compiling and running (executing) a Java program
 Using the Java Tutorials and the API Documentation
 Basic elements of the Java language
 Basic use of input, output, assignment statements in Java
 Basic Java operators

Read the problem statements below and create the Java programs required.

1. Problem Statement:
Create a program that will compute the savings for the week by providing data regarding the weekly allowance
and the average daily expenses. The average daily expenses (for 6 days) to be considered are
the following: Transportation, Food, and Load (Cell phone).
Filename: Saving.java
Below are sample outputs of the program execution. Note that red marked values are the ones entered from
keyboard while blue marked values are generated by the program.

Weekly allowance: 600 Weekly allowance: 500

Average Daily Expenses: Average Daily Expenses:


Transportation: 12 Transportation: 24
Food: 70 Food: 30
Load (Cell Phone): 10 Load (Cell Phone): 20

Total Expenses for the week: 552.00 Total Expenses for the week: 444.00
Saving for the week: 48.00 Saving for the week: 56.00

IMPORTANT!!!
In order to create a new Java program, choose File from the JCreator menu, choose New -> File .
The File Wizard should have the default option Java Classes. Click Next , type the filename as
specified in the problem, and browse through drive D: to select your folder as the location for your
file. The programs you create will be saved to this location. Note that in order for your program
to compile and run properly, your folder should contain the file Keyboard.java .
Load previous programs ( Cellphone.java and/or Numbers.java ) to serve as a guide in the creation
of your programs.

2. Problem Statement:
Write a program that accepts the amount purchased (which must be less than P100.00) by a customer and
computes for the change if the money given by the customer is P100.00. All purchases must be in pesos with no
centavos. The change must be shown with the following breakdown: P50.00, P20.00, P10.00, P5.00, and P1.00.
Filename: Purchase.java
Below are sample outputs of the program execution:

Amount Purchased: 36 Amount Purchased: 73

Change of customer is 64. Change of customer is 27.


Change breakdown: Change breakdown:
P50.00 1 P50.00 0
P20.00 0 P20.00 1
P10.00 1 P10.00 0
P5.00 0 P5.00 1
P1.00 4 P1.00 2

Hint: Use modulo division.

You might also like