Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CSE1007 – Java Programming – ELA

Fall 2021-22

ASSESSMENT - 3
Slot: L7+L8

Instructions
 Complete any two questions given below and test them with sample input.
 Prepare a PDF file containing the program and output for all the questions and
upload it in vtop by today itself.

1. Write a Java class ‘Course_Registration’ for student course registration for the
winter semester 2021-22. The name of the course and its credits are to be read from
the user. The total credits should be between 16 and 27. Create an exception class
and a ‘Credit’ class to issue a warning message when the total credit is going below
16 and above 27. Test them with a Java program.
2. Design an interface which holds the prices of three types of computer mouses. It
has a method to calculate the actual total cost of the all the computer mouses and
another method to compute the discount (given below) depending upon the
customer’s credit points in a sub package ‘Discount’ of a package ‘Product’.
If the credit point range is
1 to 9 – 10%
10 – 19 – 10%
20 – 29 – 15%
30 – 39 – 20%
40 – 49 – 25%
50 – 99 – 30%
100 and above – 40%
Create a class in ‘Product’ package to implement this interface which could read the
number of pieces required in each type of computer mouse and calculate the final cost
after discount to display.

You might also like