Beruflich Dokumente
Kultur Dokumente
Tutorial (section 3)
Work on unfinished last week’s Lab exercises.
Input
Review input from keyboard – use Scanner (see last week’s Lab exercises)
Command-line input: download sample programs from Blackboard. Compile and run them.
(see slides 40-43 of lecture 3)
Review the sample code: BankAccount.java and Bank.java in last week’s Lab
Task I
Create a new class Student which has the following variables in it.
The class should have a constructor that initializes the name, Registration number and Age. The
course could be assigned later on by calling a function setCourse( ) that sets the value of course.
This function should have a parameter for accepting the value of course.
The output of the shaowAge should be like: Hello John, you are 21 years old.
The output of showCource should be like: Hello John you are registered in MS Networks.
Use the class Student in another program by creating an object of the Student class. Call functions
of the Student class from that object.
Task II
Type the class Dotter in notepad and compile it. Type the other class DriveDotter in notepad and
compile and run it. The DriveDotter class uses Dotter class objects. Add one more mode that
prints $
1
HET755
QUIT<ret>
Return: Connection to host lost.