Subscribe to Get Free Material Updates!
Visit my new blog WebData Scraping - Web Scraping Service provider company in India.

GTU MCA Sem 3 Java Practical Programs


I posted this Java programs for practice purpose. The ten programs given below are the Java programs which were asked in previous year GTU MCA  Java practical examination organized at Ahemdabad and Gandhinagar.


Download PDF version of This Programs
     
  1.  Create a package "sales" with following items:
    • Create a class naming “Order” containing orderDate (type as java.util.Date), productName  (type as String) and quantity (type as int) as its member fields. SystemDate should be used as orderDate.
    • Create a class naming “OrderManagment”, which manages instances of Order. This class must provide following methods :
      • placeOrder: It should accept productName and quantity as its arguments, it should create a new Order instance using both arguments(productName and quantity) and adds it to TreeSet collection.
      • displayOrdersByDate:Displays all the orders placed by current customer order by orderDate.
      •  displayOrdersByName: Displays all the orders placed by current customer order by productName.
      • storeOrder: It should accept Order instance as its arguments. It stores that Order instance to the file called ordersinfo.txt. (Use Comparable and Comparator interface).


  2. Create an applet naming “timer”, which displays current time in middle of the applet screen in RED color once applet started. Provide a menu with two options: 
    • StartTimer – if user presses StartTimer then timer should start and showing updated time after each minute in random color.
    • StopTimer - if user presses StopTimer then timer should stop and display message to user that how many minutes/seconds have spent since user has started the timer.


  3. Create a menu driven application naming drawShape using GUI, which has menu option like Line, Rectangle, Oval, etc…
    • When user clicks on Line then ask user to enter line parameters using input dialog box and if parameters are proper then line should be drawn with BLUE color. Otherwise display proper error message.
    • When user clicks on Rectangle then ask user to enter rectangle parameters using input dialog box and if parameters are proper then rectangle should be drawn with RED color. Otherwise display proper error message.
    • When user clicks on Oval then ask user to enter oval parameters using input dialog box and if parameters are proper then oval should be drawn with GREEN color. Otherwise display proper error message.
    • At a time only one shape should be displayed by frame.


  4. Create a package “BankInfo” with following items
    • Create a class naming “Account” with accountId (type as int), balance (type as double) and accountType (type as char), creationDate (type as java.util.Date) as its member fields.
    • Create a class naming “Bank” class which manages a number of Account instances. Provide following methods 
      • OpenAccount (Account acc) - adds acc instance to HashSet collection.
      • CloseAccount (Account acc) – removes acc from collection.
      • ListAccOrderByBalance () – which displays all account information order by balance.
      • ListOrderByDate () - which displays all account information order by creationDate.
      • Store (File flName) – which stores all accounts info to a file flName provided as parameter.  (Note : Use Comparable and Comparator iterfaces).
    • Create a class naming “BankIntoTest” which tests above mentioned classes with main method.

  5. Design a module called NewBookEntry for LibraryManagement system using GUI.
      • This module manages information like bookId, category(MCA Sem -1, MCA Sem – 2, MBA Sem-3, ……..), title, author, edition, publication, IssueFlag (Y, N – Use checkbox).
      • Make a NewBookEntry form which allows user to enter above mentioned information and provide menu option like Save, New, Search.
      • Once user clicks Save option a unique bookId should be generated and all details along with bookId should be stored in a file called bookinfo.txt.
      • Once user clicks New than all entered details should be cleared from NewBookEntry form.
      • Once user clicks Search than whatever category user has selected, that category details should be searched in bookinfo.txt file created in option save, if details are available then display in TextArea field otherwise display proper message (eg. If user selects category MCA Sem-3 then searches this category details in file bookinfo.txt).

  6. Create a package called “residence” with following items:
    • Create a abstract class naming “Residency” which will be having an area (like 130 sq.yard, 180 sq.yard, etc..) and rate_peryard (like 20000, 18000, etc..) as its member fields and has following methods.
      • Provide necessary constructor, getter and setter methods for this class.
      • Provide one method called calculatePropertyPrice () which will return basic price (Hint : price = area * rate_peryard).
    • Create a class naming “Flat” which is inherited from Residency and having its own instance field as maintenanceCharge. Override the calculatePropertyPrice () method which will return price of a flat with maintenaceCharge.
      • Override necessary methods from Object class.
    • Create a class naming “Villa”, which is inherited from Residency and having its own instance field as furnitureCharge.Override the calculatePropertyPrice () method which will return price of a Villa with furnitureCharge.
      • Override necessary methods from Object class.
    • Create a class naming “TestResidency” which tests above mentioned classes with main method. This class creates an array of Residency type and has following method.
      • Int searchResidency (Residency res) – which searches a res instance in an array of Residency. If available then return index otherwise display proper message.
      • double totalMaintenancePrice (Residency[] houses) - which returns total of all residency’s maintenanceCharge.
      • Void DisplayOrderByPrice – which displays array of residencies order by their price (Note : Use Comparable and Comparator interfaces).

  7. Create a multiThreading application.
    • One thread will read char data from a file and print it to console (user has to create one file manually with char data separated by space).
    • Second thread called asciiVal will display ASCII value of char data read by first thread to console.
    • Use interThreadCommunication to generate following type of output.  (Assuming file has data like – T E C H N O L O G Y ……)
      • Char value : T
      • ASCII Value : 84
      • Char Value : E
      • ASCII Value : 69
      • Char value : C
      • ASCII Value : 67
      • Char Value : H
      • ASCII Value : 72

  8. Create a GUI application which calculates charges for stay in Hotel, which allows user to enter duration as start date and end date as period while user wants to book a hotelRoom and to select a particular roomType (Regular, Delux, Cottage, Family, etc… use list). After selecting a particular roomChoice, display the calculated charges with start date and end date to user in dialogBox for confirmation. If user says ok then store these details to file else just close the dialogBox. Regular rates per day are as per following table. If user start date is between April to June or October to November, then room charges increased by 15%.

  9. Create an applet naming “UnitConversion”, which allows user to select a particular conversion from following options.(Use list) 
    • Decimal to HexaDecimal [Use Inter.toHexString()]. 
    • Decimal to Octal [Use Inter.toOctalString()]. 
    • Feet to Centimeter.(1 feet = 30.48cm) 
    • Inches to Feet (1 feet = 12 inches) 
    • Once user selects particular conversion then show the converted value with proper formatted message in dialogBox.(Like if user selects Inches to Feet option and input value is 60 then message should be “60 inches is equal to 5 Feet”.) 
    • If user enters any wrong kind of input then prompt proper errorDialog and clear the entered value.

  10. Create a GUI application, which has one menu. MenuItems are ReverseOrder, UpperCase, LowerCase, ArrangeAlphabetically and Length. 
    • Once frame displayed it will display your full name in middle of screen. 
    • If user clicks on ReverseOrder then it will display your name in reverse order with random color.
    • If user clicks on LowerCase then it will display your name in lowercase with random color.
    • If user clicks on UpperCase then it will display your name in UpperCase with random color.
    • If user clicks on Arrange then it will display your name in alphabetical order in random color.(Like INDIA – will be as ADIIN).
    • If user clicks on Length then it will display length of your First name in random color.If length is greater than 9 then it will display message “Very Big Name” in MessageBox.

1 comments:

GTU Study Material said...

Paper Solution for MCA students of GTU
GTU Study MaterialGTU Study Material-Paper Solution

Post a Comment

Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes