Skip to main content

Practice Set 2





1. Write an application for Mobile Store where the user can view the available mobile phones in the store according to his/her preference. Store the mobile phone objects having attributes model number, OS, and Price. User should be allowed to filter the phones on the basis of those features.
If user selects the model number, then ask to enter the model number and then display all the details of the phone with the given model number.
If user selects OD then ask to choose the OS( Android/Windows/IOS) and display all the mobiles with that OS.
If the user selects Price then ask to enter the minimum and maximum amount and display all the mobiles which can be bought with that amount.
Now ask the user to select the mobile and display the details and bill.


2. Write an application for Cellular Company which provides different post paid plans for Calling/SMS. Ask the user to select the service provider and Display the menu to select the plan/pay bill. If user wants to select the plan then display the available plans as shown below:
E.g.          

 Plan           Rate        Free Call           Additional Call              Free SMS               Additions SMS      Validity                                


Airtel S1         49                0                           30 P/Min                               100                           50 P/sms                 14 days


Airtel Pro        110         200 min                    40 P/min                                50                             30 P/sms                 28 days

Vodafone         98           100 min                    50 P/min                                250                          25 P/sms               28 days   

Ask the user to enter the mobile number and choose the plan. Store the details of the chosen plan.
If the user wants to pay the bill then ask to enter the mobile number and number of minutes consumed and sms used.
Generate he bill according to the plan chosen by the user.                                                                       

3. Write a program to create a banking application in which display the menu (Create Account/Deposit/Withdraw/Balance Enquiry).
If the user wants to create the new account then ask the user to enter account holder name, age, initial deposit and password, then create an account object with account number automatically assigned to the user and display the details when the account is created. Provide the methods to deposit, withdraw and view balance. Store all the account objects in an array.
If the user wants to deposit, withdraw or view balance then ask the user to enter the account number.
In case deposit, ask the user to enter the amount to be deposited and update the balance accordingly and display the updated balance.
In case of withdrawal, ask the user to enter the amount to be withdrawn and password. Validate the password and if password is correct and then update the balance if the user is having sufficient balance. Otherwise display “Insufficient Balance”. In case of Incorrect Password ask to re-enter the password. If wrong, display “Your account is BLOCKED” otherwise process the request accordingly.
In case of Balance Enquiry, Display the available balance.


4. Write an application for Library Management in which read the Student Registration Number and password through the COMMAND LINE ARGUMENT. Now if the entered credentials are correct then display the name and Number of books issued to that Student.
Display the menu to Issue Book / Return Book.
If User wants to get the book issued then ask to enter the Book_ID and check in the available book record. If available, then issue the book and update the issued book count and available book record. Store the date of issue also which should be taken as an input in YYYY-MM-DD format.
If user wants to return the book, then if the book is returned within 7 days then add the book in the Available book records and decrement the issued book count in Student’s account. But if the book is returned after 7 days then impose the fine @Rs1/day. And display the fine.
[Note: Create a static list of books in the library and student registration number and password]


5. Write an application for a Tour & Travel agency which provides some tour packages which includes the details of Location, Price, Number of Nights and Hotel Category.
Ask the user to choose the location and display the available packages. Ask the user to choose the package and display the details of the selected package.
After selecting a particular package ask the user to customize the package. User can update the number of days and/or hotel category. Provide the rates for different hotel categories and increased number of nights. Display the Price after the chosen customization by the user.
After customization, display the final package of the student.
E.g.          Manali                    3 Nights/4days                      ***         Rs 2999                 
                Goa                         4 Nights/5 Days                    ***         Rs 4999
                Customization:    Rs 1000/Night                       Hotel ****  Rs 750 additional           Hotel *****          Rs 1500 additional.


6. Write an application for the Bus Reservation where ask the user to enter the Source and Destination. Display the Buses which are available for the Journey. The details of the buses should be displayed which include Bus_ID, Bus Category (Normal/Semi-delux/Volvo) Price and Available seats.
Now user can select the Bus using the Bus_ID. Ask the user to enter the number of seats he/she wants to book. Update the number of available seats in the record.


7. Write an application for placement office such that the Student objects can be stored in an array. Student contains attributes name, registration number, cgpa, course(B. Tech/MBA/M Tech) and placement status(true/false). Use appropriate constructor for the Student class.
Now implement a method which takes the minimum cgpa and eligible course as an argument and returns the number of eligible students for that placement drive. Method must display the details of all the Students who are eligible (i.e. having cgpa greater than the argument one, belong to the same course as required and are not placed.)
In main, Read the cgpa and course from the command line argument and display the eligible students.

8. Write a Health Care Application in which use an enum to store the available doctors with attributes name, consultation fee and specialization.
Ask the user to enter the patient_name, age and create a patient id automatically. Now display the details of all the available doctors and ask the user to select the doctor.
Now display the Appointment slip for the patient that includes Patient details, Patient Id and details of the Doctor along with the fee to be paid. 
Store all the details of the Patient in an Array of Objects and implement a function to display the details of the patient with a given patient id.

Comments

  1. Hello Everybody,
    My name is Mrs Sharon Sim. I live in Singapore and i am a happy woman today? and i told my self that any lender that rescue my family from our poor situation, i will refer any person that is looking for loan to him, he gave me happiness to me and my family, i was in need of a loan of S$250,000.00 to start my life all over as i am a single mother with 3 kids I met this honest and GOD fearing man loan lender that help me with a loan of S$250,000.00 SG. Dollar, he is a GOD fearing man, if you are in need of loan and you will pay back the loan please contact him tell him that is Mrs Sharon, that refer you to him. contact Dr Purva Pius,via email:(urgentloan22@gmail.com) Thank you.

    ReplyDelete
  2. I have read your blog its very attractive and impressive. I like it your blog.
    Google Cloud Platform Training in Hyderabad

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Nice article
    For java interview programs visit:
    Java programming

    ReplyDelete
  5. Thanks For Sharing his nice post. Read Our Article in Fitness And Health Releted.
    web Development Company in Surat

    ReplyDelete
  6. Good Post! Thank you so much for sharing the post, it was so good to read and useful to improve
    Java Training in Electronic City

    ReplyDelete
  7. where can i find answers for these questions?

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. what is the solution of the 7 question

    ReplyDelete
  11. can any one solve the question number 7 guys

    ReplyDelete
  12. anybody plzz give solution for ques 8

    ReplyDelete
  13. ques 8 plzz solution plzz fast plzzzzz

    ReplyDelete
  14. Nice Blog!!! keep Posting!!!

    Trekking And Camping in Dharamshala Dhauladhars Range – Kangra Valley –
    Drop us a line and we will plan these treks for you! We will make it come true. No matter how strange or wild or tricky.
    Himalaya Cab Provide Best Taxi services in dharamshala & kangra.
    We offer pickup & dropoff Taxi services from Dharamshala airport to Mcleodganj.
    Dharamshala taxi services www.himalayacab.com


    Best Taxi Service in Kangra,
    Best Tax Service in Mcleodganj, Best Taxi Service in Gaggal Airport, Best Taxi Service in kangra Airport, Best Taxi Service in Dharamshala Airport

    ReplyDelete

Post a Comment

Popular posts from this blog

Practice MCQs

  1. What will be the Output of the following code? class X{                  static int x = 1;                        static class Y {                              static int y = x++;                                static class Z                                                                       {                                                                                         static int z = ++y;                                                                        }                                               }                }   class MainClass{     public static void main(String[] rk)    {                             System.out.print(X.x);                                             System.out.print(X.Y.y);                             System.out.print(X.Y.Z.z);         } } A. 113 B. 123 C. 111 D. None of These Ans: A 2.  Which of the following statement is TRUE about t he following code? public class Outer  {    private i

Practice Set

1. Write a program to create a class Voter which contains attributes name, date_of_birth and voter_id and voter has a Voter_Card. Provide appropriate constructor to initialize all the attributes of the Voter but voter id must be assigned automatically only when the age of the voter is greater than or equal to 18 years. VoterCard is a nested class with attributes voter_id and Voter_name. Make sure that voter card is created only when user is a valid voter and if it is already created then must not be assigned the new voter id. 2. Write a program to define two interfaces UGC and AICTE both having a default method int getAdmission() to take the admission and an abstract method String payFee(). getAdmission() in UGC must ask the percentage in qualifying exam and if the percentage >= 60 then generate the registration number and return. getAdmission() is AICTE must ask the user to join the counseling after 5 days and display the date of counseling and return the counseling token numb

Mock Test - 1

1. Which of the following is a byte stream class? A. ObjectInputStream B. Writer C. PrintWriter D. Scanner Ans: A 2. Which exception is thrown by read() method in InputStream class? A. IOException B. InterruptedException C. FileNotFoundException D. None of These Ans: A 3. Which of the following class is subclass of FilterInputStream? A. InputStream B. ObjectOutputStream C. FileInputStream D. BufferedInputStream  Ans: D 4. Which of these class contains the print() and println() methods? A. System B. out C. PrintStream D. BUfferedOutputStream Ans: C 5. Which of these is a method to clear all the data present in output buffer without terminating the stream? A. clear() B. fflush() C. flush() D. close() Ans: C 6. Which of these classes defined in java.io and used for file-handling are abstract? (i) InputStream        (ii) PrintStream    (iii) Reader        (iv) FileInputStream A. Only i     B. i and ii    C. Only iii    D. i and iii Ans: D 7. What is the output of this program? class MyE