You are on page 1of 3

CS6203C TOPIC: JAVA LANGUAGE

Object Oriented Period: Prelim


Programming Machine Problem

Objectives After completing this requirement, you will be able to:


▪ Identify classes and objects in java.
▪ Define packages in JAVA
▪ Define inheritance and polymorphism
▪ Identify the parent class and child class.
▪ Understand the concepts of encapsulation in JAVA

Prerequisites Before working on this activity, you must:


▪ You have to setup IDE(NetBeans) to write, compile and run the JAVA
program.
▪ Basic knowledge in java syntax
▪ Basic knowledge about programming fundamentals and programming
operator
▪ Basic knowledge in control structure and array

*********************************************Start Here**************************************************

PRELIM LAB EXAM ACTIVITY1:

Instructions: Write a JAVA program to evaluate the net salary of an employee given the following
constraints:

1.Basic salary: User will submit


2. DA : 12% of Basic salary
3.HRA : $150
4.TA : $120
5.Others : $450
6.Tax cuts – a) PF :14% of Basic salary and b) IT: 15% of Basic salary
7.Net Salary = Basic Salary + DA + HRA + TA + Others – (PF + IT)

Requirements:
1.Use NetBeans/ Eclipse to write, compile and run the program
2. Uploaded file should be a single file with pdf file format with screenshots

Where to submit?
Submit your file in your LMS account under Week 1
Your filename should be: SUBJECT CODE_FIRSTNAME_LASTNAME
Example: CS6203C_JOHN_PASCUAL

Additional requirement:
1. Upload the executable file in your google drive
2. After uploading share it with my email address msultana@ama.edu.ph
[[ In the VC time I will make you Co-Host and check your activity]
Sample output:
PRELIM LAB EXAM ACTIVITY 2:
Write a java program to find even elements and odd elements in array . The output should be as
similar as given below.

SAMPLE OUTPUT:
Enter Size of Array : 5

Enter any 5 elements in Array:

10 4 5 2 7

Even Elements: 10 4 2

Odd Elements: 7 5

PRELIM LAB EXAM ACTIVITY 3:

Write a java program to delete a element in an array from specific position. The output should be
as similar as given below:

SAMPLE OUTPUT;

Enter Data in Array: 10 20 30 40 50


Stored Data in Array: 10 20 30 40 50
Enter poss. of Element to Delete: 2
New data in Array: 10 20 40 50

PRELIM LAB EXAM ACTIVITY 4:

Write a java program -----the output should be as similar as given below:


SAMPLE OUTPUT:
*
*A*
*A*A*
*A*A*A*

PRELIM LAB EXAM ACTIVITY 5:

Write a java program that reads the 8 integer numbers from the user into an array, then it will do
the following:
• Remove duplicate elements from an array.
• Find the second largest element in an array.
• Find the second smallest element in an array.

You might also like