Pangasinan State University
Lingayen Campus
Mathematics Department
Major Elec 1 - Java Programming
Final EXAM
I. Write user defined functions for the following operations (make sure to accept 2
parameters (integer values): (1) Addition, (2) Subtraction, (3) Division and (4)
Multiplication. (10pts each function)
II. a. Declare and create an array called (5pts)
- moreNumbers, of size 100, containing type short
- prices, of size 11, containing type double
- characters, of size 50, containing type char
- names, of size 80, containing type String
- shoppingList, of size 5, containing type String
b) Complete the table below with a name of each array and the relevant
values (5pts)
array name first index last index
moreNumbers 0 99
prices .
characters
names
shoppingList
III. Create a complete Java program to demonstrate the user-defined functions created in
Test A. (50pts.)
Prepared by: Jayson Tamayo