Você está na página 1de 5

FIRST PRELIMINARY PERIOD

GRADED EXERCISE #1 Using BufferedReader/JOptionPane Class and Simple Formula Creations


Duration: 1 week

1. Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours add 30% to each excess hours as overtime rate. Formula: Daily Wage = Rate per hour * No. of hours worked + OT pay 2. Create a JAVA program that will input a student name, course, student grade in quiz, seatwork, laboratory exercises, assignment and prelim exam. Compute and output the Prelim Grade. Prelim Grade = Quiz * 25% + Seatwork * 10% + lab. Exercise * 20% + Assignment * 5% + Prelim Exam * 40% 3. Create a JAVA program that will input a value of measure in inches and output its equivalent in measure feet. Conversion Factor: 12 inches = 1 foot 4. Create a JAVA program that will input an integer and output its square and cube; Example: 52 = 25 53 = 125 Input an integer: 5 <enter> The square of a 5 is 25 The cube of 5 is 125 5. Create a JAVA program that will input the following data: Employee Number, Employee LastName, Employee FirstName, Rate per hour, Number of Hours Worked. Compute and ouput the Gross Pay, SSS Deduction, Tax Withhold, Total Deduction, Net Pay Gross Pay = No. of hrs worked * rate per hour. SSS Deduction = 5% of Gross Pay Tax Withhold = 10% of Gross Pay Total Deduction = SSS Deduction + Tax Withhold Net Pay = Gross Pay Total Deductions

GRADED EXERCISE #2 Conditional Statements: If Else and Switch Case


Duration: 1 week

1. Write a JAVA program that will input a number and evaluate if the number is a Positive or Negative or Zero. If the number is positive display the message POSITIVE NUMBER, if negative NEGATIVE NUMBER, and if zero display the message ZERO. 2. Write a JAVA program that will input a students final grade from 50 -100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks if it is Passed or Failed. Final Grade Equivalent Final Grade Equivalent 98 100 1.00 83 85 2.25 95 97 1.25 80 82 2.50 92 94 1.50 77 79 2.75 89 91 1.75 75 76 3.00 86 88 2.00 74 & below 5.00 (FAILED)

3 Write a JAVA program that will input a password and test if the password is correct and display the message Password Accepted otherwise, display Invalid Password. (Note: Password is JRU or jru)

4 Write a JAVA program that will input a year code and output year level. Input => Year Code Output => Year Level 1 First Year next line Freshmen 2 Second Year next line Sophomore 3 Third Year next line Junior 4 Fourth Year next line Senior Note: Using if..else statement and year code is in character type. 5 Using switchcase statement of #4.

GRADED EXERCISE #3
Conditional Statements: If Else and Switch Case
Duration: 1 week

1. Write a JAVA program that will input the following data: Student Name, Average, Tuition Fee and output Total Tuition Fee. Formula: Total Tuition Fee = Tuition Fee Discount If average is: 95 100 100% discount 90 94 25% 85 89 10% 84 and below no discount 2 Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours add 30% to each excess hours as overtime rate. Formula: Daily Wage = Rate per hour * No. of hours worked + OT pay

3. Write a JAVA program that will input a users choice based on the table below: Choice Input the following Compute & Output C for Circle Radius of a Circle Area = r2 S for Square Side of Square Area = s2 R for Rectangle Length & Width of a Rectangle Area = lw T for Triangle Base & Height of a Triangle Area = 1/2 bh 4. Write a JAVA program that will compute for the net income of a particular employee. You have to accept name, position, and number of days worked. The position has three categories: if Manager, rate per day is P500; if Supervisor, P400; if Employee, P300. Then after accepting the rate per day, compute gross = rate per day * no. of days worked, compute for the bonus, if gross is >= 8000, bonus = 1000; if gross>= 5000, bonus = 750; if gross >= 3000, bonus = 500; if less, bonus = 0; compute for the deductions: SSS is always 10% of gross; Medicare is always P100; and TAX, if gross >= 7000, tax = 15% of gross; if gross >= 4000, tax = 10% of gross, if gross >=2000, tax = 5% of gross. Then, compute for Net Income = gross + bonus total deduction. Then, display the net income. Sample Output: Name: Richard <enter> <m> Manager <s> Supervisor <e> Employee Position: s <enter> Rate: 400 No. of Days Worked: 15 <enter> Gross: 6000 Bonus: 750 Deductions: Tax: 600 SSS: 600

Medicare: 100
Total Deduction: 1300 Net Income: 5450

GRADED EXERCISE #4 Looping Statements


Duration: 2 weeks

1. Write a JAVA program that will generate/output the following numbers. 1, 2, 4, 7, 11, 16, 32, 39, 47, 56, 66 2. Write a JAVA program that will input 10 scores and output the Highest and Lowest score. 3. Write a JAVA program that will input the base and power and display the result: Example: Base is 4 Power is 2 the answer is 16 42 = 16 Base is 2 Power is 5 the answer is 32 25 = 32 Base is 0 Power is any no. the answer is 0 08 = 0 Base is any no. Power is 0 the answer is 1 70 = 1 Base is 0 Power is 0 the answer is Indeterminate i.e.: 00 = Indeterminate (Note: Math.pow( ) method is not allowed) 4. Write a JAVA program that will input an integer number, and then will output the sum of all inputted numbers. The program will stop in accepting inputs if the user entered 0 (zero). Sample run #1: Sample run #2: Enter a number: 10 Enter a number: 7 Enter a number: 25 Enter a number: 13 Enter a number: 0 Enter a number: 5 Enter a number: 0 Sum: 35 Sum: 25 5. Write a JAVA program that will generate the given output: Sample run #1: Sample run #2:

Enter number of times: 3 Number (1) : 10 Number (2) : 5 Number (3) : 2


Difference: 3 Product: 100

Enter number of times: 5 Number (1) : 8 Number (2) : 4 Number (3) : 2 Number (4) : 3 Number (5) : 0
Difference: -1 Product: 0

Você também pode gostar