0% found this document useful (0 votes)
80 views3 pages

Oop-Prelim Lab Exam Activity

This document provides instructions for completing 5 Java programming activities as part of a prelim lab exam. It includes the objectives, prerequisites, and requirements for each activity. Activity 1 involves writing a program to calculate an employee's net salary based on their basic salary and other factors. Activity 2 finds even and odd elements in an array. Activity 3 deletes an element from a specific position in an array. Activity 4 prints a triangle pattern of asterisks. Activity 5 removes duplicate elements from an array, finds the second largest element, and finds the second smallest element. Students are instructed to use an IDE like NetBeans to write, compile and run their programs, and submit the files by a deadline.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views3 pages

Oop-Prelim Lab Exam Activity

This document provides instructions for completing 5 Java programming activities as part of a prelim lab exam. It includes the objectives, prerequisites, and requirements for each activity. Activity 1 involves writing a program to calculate an employee's net salary based on their basic salary and other factors. Activity 2 finds even and odd elements in an array. Activity 3 deletes an element from a specific position in an array. Activity 4 prints a triangle pattern of asterisks. Activity 5 removes duplicate elements from an array, finds the second largest element, and finds the second smallest element. Students are instructed to use an IDE like NetBeans to write, compile and run their programs, and submit the files by a deadline.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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 [email protected]
[[ 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