Sei sulla pagina 1di 3

José Rizal University

Midterm Exercises

Laboratory Exercise No. 1

Create an html and JSP file for this problem. The JSP file is named as PrelimGrade.jspthat will display the student prelim grade based on the user‟s request parameter from the html file named “PrelimCompute.html”.

Prelim Grade = Quiz * 20% + Seatwork/Ass * 15% + lab. Exercise * 25% + Prelim Exam * 40%

PrelimCompute.html

Student Number:

09-123456

Student Name:

Dela Cruz. Juan J.

Course:

BSIT

Subject/Section:

ITC I 306I

PRELIM GRADE COMPUTATIONS:

Quizzes:

Quiz 1:

2.2

Quiz 2:

4.0

Seatwork/Ass:

SW:

5.0

Laboratory:

Exercise:

3.0

Major Exam

Prelim Exam:

2.8

Submit
Submit
Reset
Reset

PrelimGrade.jsp

Student Prelim Grade:

09-12345

Dela Cruz, Juan J. BSIT ITC30 / 306I

Prelim Grade:

3.0

Remarks:

Passed

José Rizal University

Midterm Exercises

Laboratory Exercise No. 2

Create and design JSP that would input a student‟s 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”, else “Out of range”.

Final Grade

Equivalent

98-100

1.00

95-97

1.25

92-94

1.50

89-91

1.75

86-88

2.00

83-85

2.25

80-82

2.50

77-79

2.75

75-76

3.00

74 & below

5.00

(Failed)

Laboratory Exercise No. 3

Write a JSP program, using either a while loop or a do-while loop, to print the entire set of three-digit Armstrong numbers. An Armstrong number is one that

satisfies the following condition: a 3 + b 3 + c 3

= abc. The following is an

example of an Armstrong number: 1 3 + 5 3 + 3 3 = 153

Files name: Armstrong.html & ValidateArmstrong.jsp

The Armstrong Numbers are: 153, 370, 371, and 407.

Useful tips:

Write a for loop with the value of the counter variable varying from 100 to 999.

Extract each digit of the counter variable

Cube each of the digits and add those cubes

Check if the sum of the cubes is equal to the counter variable

If both are equal, then print „This is an Armstrong Number!‟

Else „This is not an Armstrong Number.

José Rizal University

Midterm Exercises

Laboratory Exercise No. 4

Create an online music database web application. The main page has list all, add and search music item. The “list all item” displays all music item records from the database. The “add item” creates new music record to the music database. The “search item” searches the music record. Once the music record found, it display the details of the record and has option to edit or delete the music record. a. Create the header named musicheader.jsp and footer named musicfooter.jsp to be included for all web application to be displayed.

Below is the music table specification:

Database: dbmusic Table: music1

Field Name

Type

Length

musicid

int

5

PK

musictype

varchar

20

musicname

varchar

15

artist

varchar

30

recordcompany

varchar

20

language

varchar

15

Note:

//Minimum of 5 records

musicid:

12341 - 12345

musictype:

rnb, rock, alternative, classic, ballad