Skip to content

tazeenm/JavaLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Programs - Semester 6

  1. Create a class called account with the data members(Accno – integer, name String, Phone_No: integer, balance_amt:float), and following methods : a. getinput() to get input from the user b. Deposit() method which takes the amount to be deposited in to his/her account and do the calculation. c. Withdraw() method which gets the amount to be withdrawn from his/her account. Print the appropriate results.

  2. Write a Java Program that does the following related to Inheritance: a. Create an abstract class called Vehicle which contains the ‘year_of_manufacture’ data member and two abstract methods ‘getData()’ and ‘putData()’ with a constructor. b. Create two derived classes “TwoWheeler” and “FourWheeler” and implement the abstract methods. Make “FourWheeler” as final class. c. Create class ‘MyTwoWheeler’ which is a sub-class of “TwoWheeler” and demonstrate the use of super keyword to initialize data members of “MyTwoWheeler”.

  3. Write a Java Program that does the following related to Packages and Interfaces , Exception Handling: a. Create an interface Student which gets the name and branch of a student. b. Create a package called ‘StudentPackage’ which has a user-defined class RegisterStudent. c. If a student registers above 30 credits for the semester, the method should throw a user-defined exception called ‘CreditLimit’ and display an appropriate message. d. Create another package called ‘ResultPackage’ which displays the grade for the subject registered for particular semester and if the CGPA is in invalid format 55 of 69 throw NumberFormatException also if CGPA is above 10 then throws an InvalidCGPA user-defined exception. e. Collect the marks of all the semesters and display the SGPA with minimum calculation of 4 semesters.

  4. Write a Program that simulates a telephone that records missed incoming calls. For each missed call, store the time of call, telephone number of origin, and name of the called if the name is available. For unlisted numbers, set the name to “private caller”. Choose or extend the most appropriate collection class and provide the following features. a) Numbers are recalled in the order they arrive b) Up to 10 numbers are recorded. When the eleventh call comes in, it is stored and the oldest call is deleted so that no more than 10 numbers are ever recorded. c) After each number display, the user can select a. to delete the call b. to go on to the next missed call, or c. to display the call details (number, caller name and time). d) Delete the number if user specifies a number to delete. Write a helper class to represent an incoming call with fields to hold the number, name of the caller, and time of the call. Write a tester call that stores the several numbers, simulate the user pressing the missed-calls button, and finally prints the entire collection of stored calls.

  5. Write a program that uses Java Swing and JDBC to create a stand-alone application: a. Create two tables namely, Representative (RepNo, RepName, State, Comission, Rate) and Customer (CustNo, CustName, State, Credit_Limit, RepNo) in MySQL database. b. Use appropriate Swing components to insert values in a form. c. Use another form to display Representative’s information whose Credit_Limit is above 15,000.

Tshirt: Write a JSP and Servlet Program to do the following to buy a T-Shirt online: a. A set of checkboxes to select your T-Shirt accessories such as ‘belt’, ‘cap’, ‘hair-band’ etc. b. A text area / text field to enter your T-Shirt tag-line 56 of 69 c. A Radio-button that allows the user to choose between T-Shirt with chest pocket and without. d. A Combo Box to choose your T-Shirt color e. Appropriate labels for these GUI Components f. A Button called “Click Me” which when pressed will g. Insert the details entered into a table called ‘TShirts’. h. An OrderNo is generated by adding ‘1’ to the existing ‘OrderNo’ i. If ‘TShirts’ table is empty the initial value of ‘OrderNo’ is 100. j. This ‘OrderNo’ is also inserted into the ‘TShirts’ table k. Display all the records of the ‘TShirts’ table in tabular form

Telephone: Create a Telephone Directory Application using Servlet that searches the database based on phone number or name. Also show database table creation with inserting 2-3 values to the table. a. Database Name: OnlineDirectory b. Table Design: i. Table Name: Telephone_Directory ii. Attributes: Phone_Number, Name, Address, Company, Pin_Code.

ITProgram: Create a Servlet to file IT returns that accepts personal information, salary information and Tax deduction details from the user and write the information into a file. Also accept the name of the person and display in on the page.

About

Java Programs - Semester 6

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published