CSE111 Lab Assignment 6 - Fall'24
CSE111 Lab Assignment 6 - Fall'24
Number of Tasks: 11
[Submit all the Coding and Tracing Tasks (Task 1 to 11) in the Google Form
shared on buX]
[You are not allowed to change the driver codes of any of the tasks]
Task 1
Write the “Product” class to show the following output
Note: Make sure to use proper Encapsulation concepts for the setter & getter methods.
All the attributes should have Private access.
System.out.println("==========4==========");
System.out.println("Total Books Sold: " + Book.total_books_sold);
System.out.println("Total Revenue: "+Book.total_revenue + " TK");
}
}
Task 4
Write a class called Circle with the required constructor and methods to get the
following output.
Subtasks:
1. Create a class called Circle.
2. Create the required constructor. Use Encapsulation to protect the variables.
[Hint: Assign the radius variable in private]
3. Create getRadius() and setRadius() method to access variables.
4. Create a method called area to calculate the area of circles.
Task 1
Design the SultansDine class with the necessary property to produce the
output from the given driver code.
Subtaks:
1. Create SultansDine class
2. Create 2 static variable and 1 static array
3. Create 1 static method
4. Calculation of branch sell is given below
a. If sellQuantity < 10:
i. Branch_sell = quantity * 300
b. Else if sellQuantity < 20:
i. Branch_sell = quantity * 350
c. Else
i. Branch_sell = quantity * 400
5. Calculation of branch’s sell percentage = (branch’s sell / total sell)
* 100
Task 2
Implement the design of the Travel class so that the following output is produced.
Use Encapsulation to protect the variables. [Hint: Assign all the variables in
private]