0% found this document useful (0 votes)
76 views15 pages

Lab Guides: Java SE 8 Programming Language

This document describes a lab assignment on Java I/O fundamentals. The objectives are to implement input/output functionality for reading and writing text/data files. Students will create classes for a Student entity with attributes like ID and GPA, a Course entity with attributes like title and students enrolled, and an interface for course statistics. The lab involves writing methods to enter course data, save to a file, sort by ID, search by student, remove courses, and view statistics. Screen designs and guidelines are provided for setting up the project structure and classes.

Uploaded by

Le Doan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views15 pages

Lab Guides: Java SE 8 Programming Language

This document describes a lab assignment on Java I/O fundamentals. The objectives are to implement input/output functionality for reading and writing text/data files. Students will create classes for a Student entity with attributes like ID and GPA, a Course entity with attributes like title and students enrolled, and an interface for course statistics. The lab involves writing methods to enter course data, save to a file, sort by ID, search by student, remove courses, and view statistics. Screen designs and guidelines are provided for setting up the project structure and classes.

Uploaded by

Le Doan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Java SE 8 Programming Language

Lab G ui des

Contents
Long Lab 1 – Option 1: Java I/O Fundamentals...............................................................................4
Objectives:.................................................................................................................................... 4
Lab Descriptions:.......................................................................................................................... 4
Business Rule:.............................................................................................................................. 4
Functional Requirements:............................................................................................................. 5
Screen Design:............................................................................................................................. 5
Guidelines:.................................................................................................................................... 7
Lab Guides Java SE 8 Programming Language

Internal use 2/15


Lab Guides Java SE 8 Programming Language
CODE: Lab009
TYPE: Long
LOC:
DURATION: 180 MINUTES

Long Lab 1 – Option 1: Java I/O Fundamentals


Objectives: JPL-14
o Implement input / output (I/O) functionality for reading from / writing to text / data files and
understanding advanced I/O streams.
Lab Descriptions:
For the hierarchy below, the trainee will create java classes that will implement this class diagram. Your
classes should be able to show relationship between the entities.

Create a class called Student with the following information:

» Four private instance variables: id (String), name (String), phone (String), gender (String), and gpa
(double).

» One constructor to initialize the id, name, email, and gender with the given values. Also including
getter and setter method.
And, a class called Course with the following information:

» Five private instance variables: id (String), title (String), student (of a class Student you have just
created), credit (double), and enrollment (int).

» One constructor to initialize all the given values. Also including getter and setter method. -
Implements Statistical interface.
Finally, an interface Statistical:

» For Course, it will return the summary of how many students get grade A, B, C, and D. You will use
Map for this case.

Business Rule:

» Phone: must be at least 10 digits

» Student Id: 6 digits (i.e. 123456)

» Course Id: 2 upper case letter follows by 3 digits (i.e. CS141)

Internal use 3/15


Lab Guides Java SE 8 Programming Language
Functional Requirements:
a. Write a method to enter Course data, users will be asked whether to continue or finish.
Finish typing data when the user select ‘n’ or ‘N’ or the number of students in the course exceed
enrollment.
The students in a course and Course Id must be unique.
b. Write a method to save the entire course list into “course.dat” file.
c. The program has a method to sort course by id and display data in the following format:

d. The program has a method to search for courses that a student has taken by him/her id.
e. Write a method to remove a course from course file.
f. Write a method to get the ranking of all the courses

Screen Design:

---------------------------MENU-------------------------
1. Create new Course
2. Save to File
3. Sort by Id
4. Find by Student
5. Remove course
6. Course Statistic
7. Exit
Select: 1
Enter course id:
JA001
Enter course title:
JAVA
Enter course credit:
2
Enter course enrollment:
2
----Enter Student in the Course----
Enter student id:
123456
Enter student name:
DUNG
Enter gender:
MALE
Enter gpa:
8
Enter phone:

Internal use 4/15


Lab Guides Java SE 8 Programming Language

---------------------------MENU-------------------------
1. Create new Course
2. Save to File
3. Sort by Id
4. Find by Student
5. Remove course
6. Course Statistic
7. Exit
Select: 1
Enter course id:
JA001
Enter course title:
JAVA
Enter course credit:
2
Enter course enrollment:
2
----Enter Student in the Course----
Enter student id:
123456
Enter student name:
DUNG
Enter gender:
MALE
Enter gpa:
8
Enter phone:

Select: 3

Select: 4

Select: 6

Guidelines:
Internal use 5/15
Lab Guides Java SE 8 Programming Language
» Step1. Create a project named as below:

» Step2. Create package that contains Course, Student, CourseTitleCompare, Statistical classes:
Statistical interface:

Course class:

o Add getter/setter
Student class:

Internal use 6/15


Lab Guides Java SE 8 Programming Language

o Add getter/setter

CourseTitleCompare class:

» Step3. Create package that contains Constant, Validator, PhoneFormatException,


InvalidIdException classes:

Constant class

Validator class:

Internal use 7/15


Lab Guides Java SE 8 Programming Language

PhoneFormatException class:

Internal use 8/15


Lab Guides Java SE 8 Programming Language

InvalidIdException class

» Step4. Create package that contains StudentService, CourseService classes:

StudentService class

Internal use 9/15


Lab Guides Java SE 8 Programming Language

Internal use 10/15


Lab Guides Java SE 8 Programming Language

CourseService class:

Internal use 11/15


Lab Guides Java SE 8 Programming Language

Internal use 12/15


Lab Guides Java SE 8 Programming Language

Internal use 13/15


Lab Guides Java SE 8 Programming Language

» Step4. Create package that contains CourseManagement classes:

CourseManagement class

Internal use 14/15


Lab Guides Java SE 8 Programming Language

-- THE END --

Internal use 15/15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy