Practical - Exercise2 (Class and Default Const)
Practical - Exercise2 (Class and Default Const)
INSTRUCTIONS:
You are required to write a program in JAVA based on the problem description given. Read the
problem description and examine the sample of output; then study the program design given.
Using the problem-solving tips as a guide, write a complete program with necessary useful
comment for good documentation. Compile and execute the program.
ASSIGNMENT OBJECTIVES:
1. Learning objectives
a. To introduce business problem specification/requirement and translates into JAVA codes.
b. To practice writing simple application of deploying object-oriented programming concept
using JAVA.
2. Learning outcomes:
a. Reflect ability to write a program consisting of data members, a constructor, and set and
get methods.
b. Perform set and get method calls according to the given program flow.
c. Translate user specification into JAVA statements.
d. Write and compile an error free JAVA application.
DESCRIPTION OF PROBLEM:
Write a program contained a class Student which has firstName, lastName, mark, grade. The
class allows object instance to assign firstName, lastName and mark from input user and
perform and assign grade based on mark’s criteria displayed below.
Table 1
MARKS 95 - 90 - 85 - 80 - 75 - 70 - 65 - 60 -
0 - <60
INTERVAL 100 <95 <90 <85 <80 <75 <70 <65
LETTER
A+ A B+ B C+ C D+ D F
GRADE
SAMPLE OF OUTPUT:
-------------------------------------------------------------------
First Name Last Name Grade
John Kendall A+
-------------------------------------------------------------------
FirstName Last Name Grade
Mary Kendall C+
f) A main program in which will create object instances, then derives user
input and perform suitable set and get method to reflect output as shown /8m
above.
Total /20m