Sei sulla pagina 1di 1

19CS1203 - OBJECT ORIENTED PROGRAMMING

CO: 3

PART - A
The Course class has the following private fields: courseCode,
courseTitle (both of type String)
and credits (type int). It also contains assessors and mutators
for each attribute. 1. courseCode
1 e. 10 Marks
must have 6 characters (only digits and characters) 2. Credits
must be a positive value less than
6. Also code the toString( ) method to display the data of
courses and draw the class diagram.
(or)
The Product class has the following private fields:
productCode, productName, batchNo (both of
type String) and price (type int). It also contains assessors
1f and mutators for each attribute. 1. 10 Marks
productCode must have 6 characters Also code the
toString( ) method to display the data of
Product and draw the class diagram.
PART - B
Develop a class Time with attributes Hours, minutes and
seconds. Write setter, getters and
4.a toString methods. The setter method must generate an 15 Marks
exception whenever the invalid time is
given as an argument.
(or)
Develop a program to create two threads to displays the sum of
4.b 1 to n numbers and to print all the factors of number n. 15 Marks

Potrebbero piacerti anche