1. WAP to create a class Person with attributes Name, Age and Mobile Number and a method to display the details of a person and an abstract method to assign the designation of the person as per the user input at run time. Create two subclasses of Person as Student and Employee and write the methods to accept the Organization name from the User at runtime and methods to display all the details of Student/Employee. Create the objects of both the subclasses using constructors to initialize the instance variables of the class and then display all the details of both.
2. WAP to create a class Vehicle having data members Mileage and fuel and methods to add the fuel. Create two sub classes of Vehicle i.e. Bike and Car each having data members Name, and Max_Speed and method to calculate the remaining fuel. From a class Race create the objects of both the subclasses using appropriate constructors to initialize the data members after taking the input from the user. Display the remaining fuel ant time taken by both the vehicles after completion of the race.
3. WAP in which create a class Account which inherits from Bank class (which contains two methods deposit and withdraw). Overload the deposit method for cash and check. Create a class App which provides you a menu for deposit, withdraw, Account information and Exit. Perform all the above operations on the Account Number entered by the user.
4. Write a program which prompts the user to enter a String. Now implement the following method public int[] countVowels(String s) which returns the array containing the number of vowels in String s. Where the count of a,e,i,o,u is stored in indexes 0 to 4 respectively.
5. Write a program to implement the following method which inverts the cases of each letter of the String: public String changeCase(String str) Input: HeLP ME Output: hElp me 6. Write a program to create a class Student with attributes name, cgpa and registration_number. Use appropriate constructor to initialize the instance variables of the class. Create a class StudentData which contains an array to store the Student objects. Create at least 3 objects of the Student class and store into array. Implement a method public void findCGPA(String name, int reg) to display the cgpa of the student having that name and registration number.
7. Write a program to define a class named Employee with attributes name salary and id. Also provide a parameterized constructor to initialize all the attributes. Create a class TestEmployee in which create at least 3 employee objects and Store in an arraylist. Implement a method public void search(int id) which display the name and salary of the employee with given id.
8. Write a program which prompts the user to enter the number of subjects N and number of CAs M. Read the CA marks of every subject from the user at run time and store in a matrix. Now implement a method double[] averageCA(double [][] marks) which returns the average of CA marks for each subject in an array.
9. Write a program to create a class named Employee having attributes emp_name, emp_id and salary. Create a class Emp_Data in which create N Employee objects after taking input from the user. Store all the Employee objects in an array. Implement a method void findEmployee(int id) which displays the name and salary of the employee with argumented id.
10. Write a program to create a class named Vehicle with attributes price, mileage and fuel and a parameterized constructor to initialize all the instance variables. Vehicle class must have a method int getFuel() which returns the fuel and an abstract method public void addFuel(int f) to add the fuel. Create a subclass of Vehicle named Car with attribute car_name. Implement the addFuel method. Also override the getFuel method in Car class to display the name of the Car and return the available fuel. Create 3 Car objects and store them in an ArrayList. Implement a method getCar() to display the name and price of the Car with maximum mileage.
11. WAP to create a class Account containing Account Number, Account_Holder_Name and Balance as the data members and methods to deposit and withdraw. Create two subclasses of Account, Saving and Current. Saving must have a method to calculate the interest on the balance for 1 year with ROI 6% per annum and method to display all the details of that account. Current must have a method to change the limit of maximum withdrawl in a day. Use the constructor to create the object of each type and assign the account number automatically in a sequence.
12. WAP to create a class Result containing two attributes Marks and Grade and a method to display the Grades of the student for any subject. Create two subclasses of Result, Regular and Part-time and override the method correspondingly. From the main class, take the input from the user, name of student, course type and marks in 5 subjects and display all the details of the student and grades in all 5 subjects.
2. WAP to create a class Vehicle having data members Mileage and fuel and methods to add the fuel. Create two sub classes of Vehicle i.e. Bike and Car each having data members Name, and Max_Speed and method to calculate the remaining fuel. From a class Race create the objects of both the subclasses using appropriate constructors to initialize the data members after taking the input from the user. Display the remaining fuel ant time taken by both the vehicles after completion of the race.
3. WAP in which create a class Account which inherits from Bank class (which contains two methods deposit and withdraw). Overload the deposit method for cash and check. Create a class App which provides you a menu for deposit, withdraw, Account information and Exit. Perform all the above operations on the Account Number entered by the user.
4. Write a program which prompts the user to enter a String. Now implement the following method public int[] countVowels(String s) which returns the array containing the number of vowels in String s. Where the count of a,e,i,o,u is stored in indexes 0 to 4 respectively.
5. Write a program to implement the following method which inverts the cases of each letter of the String: public String changeCase(String str) Input: HeLP ME Output: hElp me 6. Write a program to create a class Student with attributes name, cgpa and registration_number. Use appropriate constructor to initialize the instance variables of the class. Create a class StudentData which contains an array to store the Student objects. Create at least 3 objects of the Student class and store into array. Implement a method public void findCGPA(String name, int reg) to display the cgpa of the student having that name and registration number.
7. Write a program to define a class named Employee with attributes name salary and id. Also provide a parameterized constructor to initialize all the attributes. Create a class TestEmployee in which create at least 3 employee objects and Store in an arraylist. Implement a method public void search(int id) which display the name and salary of the employee with given id.
8. Write a program which prompts the user to enter the number of subjects N and number of CAs M. Read the CA marks of every subject from the user at run time and store in a matrix. Now implement a method double[] averageCA(double [][] marks) which returns the average of CA marks for each subject in an array.
9. Write a program to create a class named Employee having attributes emp_name, emp_id and salary. Create a class Emp_Data in which create N Employee objects after taking input from the user. Store all the Employee objects in an array. Implement a method void findEmployee(int id) which displays the name and salary of the employee with argumented id.
10. Write a program to create a class named Vehicle with attributes price, mileage and fuel and a parameterized constructor to initialize all the instance variables. Vehicle class must have a method int getFuel() which returns the fuel and an abstract method public void addFuel(int f) to add the fuel. Create a subclass of Vehicle named Car with attribute car_name. Implement the addFuel method. Also override the getFuel method in Car class to display the name of the Car and return the available fuel. Create 3 Car objects and store them in an ArrayList. Implement a method getCar() to display the name and price of the Car with maximum mileage.
11. WAP to create a class Account containing Account Number, Account_Holder_Name and Balance as the data members and methods to deposit and withdraw. Create two subclasses of Account, Saving and Current. Saving must have a method to calculate the interest on the balance for 1 year with ROI 6% per annum and method to display all the details of that account. Current must have a method to change the limit of maximum withdrawl in a day. Use the constructor to create the object of each type and assign the account number automatically in a sequence.
12. WAP to create a class Result containing two attributes Marks and Grade and a method to display the Grades of the student for any subject. Create two subclasses of Result, Regular and Part-time and override the method correspondingly. From the main class, take the input from the user, name of student, course type and marks in 5 subjects and display all the details of the student and grades in all 5 subjects.
i need answere please
ReplyDeleteGood Post! Thank you so much for sharing the post, it was so good to read and useful to improve
ReplyDeleteJava Training in Electronic City