Report f1041 Dfc30133 Case Study 1 2021
Report f1041 Dfc30133 Case Study 1 2021
Report f1041 Dfc30133 Case Study 1 2021
DEPARTMENT
SESSION : 1: 2021/2022
Vision:
“To be the Leading_Edge TVET
: DFC30133 - OBJECT ORIENTED
COURSE
Institution” PROGRAMMING
CONTINUOUS ASSESSMENT : CASE STUDY 1 Total Marks: 36
TOPIC 3:
3.2.6 Build java programs using variables, operators and Input/ Output
TOPIC 3.3.1 Explain selection statements in Java programs.
3.3.2 Explain looping statements in Java programs.
Instruction:
Kampung Kelubi Library is a library located in the rural area. Borrower is allowed to borrow
maximum of three (3) books from the library.
You are required to produce a Java program using Two-Dimensional Array to help the librarian
to key in the borrower’s name and the books accordingly. You may use following code in your
program.
1
Diagram 2: Reading Data from an Array
Example of output:
Submission:
Use this question paper as the cover. Your submission must include:
1. Report – Copy paste the Java coding and screen shot the output. Save the file as
.docx or .pdf
2. Java file (source code)
2
RUBRIC CASE STUDY 1
3
Report Format:
Coding:
/*
Name : Rabiatul Adawiyah binti Mat Jamil
Reg. Number : 03DDT20F1041
Class :DDT3A
Case Study 1
*/
4
void display() //method displayTitle()
{
//display output
System.out.println("***********************************************************************");
System.out.println("\t\t Book Borrowing Table Kg Kelubi Library");
System.out.println("***********************************************************************");
System.out.print("Name" +"\t"+"Book 1" +"\t\t\t" +"Book 2" +"\t\t\t"+"Book 3" +"\n");
System.out.print(name);//display output
for (int i=0; i<1; i++) // looping statement
{
for (int j=0; j<3; j++) //for statement
{
System.out.print("\t" + booktable[i][j]);//display output
}//end of for statement
}//end of looping statement
System.out.print("\n");//display output
System.out.print(name1);//display output
for (int i=1; i<2; i++) // looping statement
{
for (int j=0; j<3; j++) //for statement
{
System.out.print("\t" + booktable[i][j]);//display output
}//end of for statement
}//end of looping statement
System.out.print("\n");//display output
}//end of method displayTitle()
}//end of class BorrowBook
5
Output: