SWE2005 Concepts of Object-Oriented Programming ELA FALL 2021-2022 Semester Lab Sessions - 10 Name: G.V.N.C.PRADYUMNA Reg No: 20MIS7088
SWE2005 Concepts of Object-Oriented Programming ELA FALL 2021-2022 Semester Lab Sessions - 10 Name: G.V.N.C.PRADYUMNA Reg No: 20MIS7088
SWE2005 Concepts of Object-Oriented Programming ELA FALL 2021-2022 Semester Lab Sessions - 10 Name: G.V.N.C.PRADYUMNA Reg No: 20MIS7088
2022 Semester
Lab Sessions - 10
Name: G.V.N.C.PRADYUMNA
Reg no: 20MIS7088
CODE:
OUTPUT:
2. Create a class for Shutterbug’s Camera Store, which is having the digital
cameras to sale.
Class DigitalCamera:
Add data fields for a brand, the number of megapixels in the resolution,
and price.
Include a constructor that takes arguments for the brand and megapixels.
If the megapixel parameter is greater than 16, the constructor sets it to
16.
The sale price is set based on the resolution; any camera with 12
megapixels or fewer is $299, and all other cameras are $329.
Also include a method that displays DigitalCamera details.
CODE:
OUTPUT:
3. Create a three different java classes Student, Marks and Grade with
necessary attributes and methods. Write a Test main class which gets the
following input and satisfies the given expected output conditions.
Verify all the functional requirements with the Test class by creating the
instances and calling the respected methods.
CODE:
OUTPUT: