Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 2.34 KB

README.md

File metadata and controls

43 lines (31 loc) · 2.34 KB

java-codes2

Assignment Questions and Solutions

Assignment Date : 13/01/2025

Submission Date : 16/01/2025

Teacher - Mr. Amitava Chattopadhyay


Questions :

  1. Create a Employee class with ename,designation,salary,email as instance variables. Create all getter/setter Now Create an Employee and print like: Ankan works as Developer with emailid [email protected] and earns 5k per annum.

  2. Create Teacher class with tname,subject and yrsOfExp with getter/setter Create Student class with sname,degree and college with getter/setter Now create another class having 2 static methods to create relationship b/w both The O/P should look like following: Ankan takes java class under Amitava Sir , Amitava teaches OOPS design to Madhu who reads as Btech Student in UEM college

  3. Write a Java program to create a class called "Book" with attributes for title, author, and ISBN, and methods to add and remove books given from command prompt also using JOptionPane.

  4. Create a java class LED having id brand and price. Now create 2 OLED as Sony and Samsung now compare their price and the higher priced tv name should be changed to Premium Model then print all to console.

  5. Create a Java class Laptop with brand , price and processor type. Now Create HP LENOVO and DELL -3 laptops. Now Create an User class with username and address and the user should compare all processors and will puchase only Intel Core Ultra based laptop.

  6. Apply Has-A relationship to create the following A person HAS AN address.(USE LOMBOK)

  7. Create a Shop which sells only Mobiles. Now create a customer and visit the shop and purchase a VIVO mobile if it has Android 15 only.

  8. Create a class to check where a student is eligible 2 vote in an election by checking age.

  9. Create a java class that will check whether a person's name is palindrome or not.

  10. Create a class that will apply a tax of 10% to the basic salary and give a bonus of 2% of basic salary and add a travelling allowance of 1.5% of basic salary. Now find the annual salary of the employee.