Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create a class Point2D , under package "com.cdac.geometry" for representing a point in x-y co-ordinate system.


Create three objects: prog, adm and lib, for programmer, admin and librarian respectively to

access the properties in Employee class.


Write a code in java to meet the following requirements

. You have an abstract representation Animal that has a method sound). Since this is abstract representation class so we can't give it a implementation.


. You have three classes horae, dog and cat. You need to provide implementation of sound method according to specific class.


. Create a class by name overload. Create the method Demo() in overload class

. Overload the method by using following instructions

Demo instance of borse, cat or dog) // in method body print sound of particular animal

Demo instance of cat and dog) // in method body print sound of particular animal

Demo Instance of cat, dog and horse) // in method body print sound of particular animal

Write main method

Create objects of horse, cat and dog class.

Call overloaded methods of overloaded class by using correct parameters.


Design a program using a console application in java NetBeans, named studentMarksReport that will print the final result obtained by a student with the weighting of each module. Make use of a class named Student that contains variables to store the student number, test result, assignment result and exam. Create a constructor that accepts the student number, test result, assignment result and the exam result as parameters and create get methods for the variables (UseJOptionePane to get variable from the user). Create a subclass called Student_Report that extends the Student class. The Student_Report overrides all getter methods and the constructor from Students. Write code for the print_report method which calculates each assessment weighting as follows:



test =25% weighting



assignment=25%weighting



exam=50%weighting




2. Write an application that contains an array of 10 multiple-choice quiz questions related to

your favorite hobby. Each question contains three answer choices. Also create an array

that holds the correct answer to each question—A, B, or C. Display each question and

verify that the user enters only A, B, or C as the answer—if not, keep prompting the user

until a valid response is entered. If the user responds to a question correctly, display

Correct; otherwise, display the correct answer is and the letter of the correct answer. After

the user answers all the questions, display the number of correct and incorrect answers.

Save the file as Quiz.java.




Write a java program on hotels bookings ask the user to book for a single room, double rooms, family of 6 room and the VIP room bookings the time and the cost must be included.

·          class Shuttle should include:

·          suitable fields as specified above. The "from" planet and the "to" planet should be Planet objects

·          a small range of accessors/mutators to process data held by the class

·          method which returns a boolean saying whether a permit given as a parameter can enter the shuttle

·          a method to process a permit moving to the destination planet;

o if the permit meets the conditions, remove it from the source planet, add it to the destination planet, update information on the permit, and return a suitable message

o if it does not meet one of the conditions, return an appropriate message and do NOT move it

·          a method toString()which returns a String representation of an object of that class (no need to list all of the planet details, just the planet numbers and names)

 

t

 



·   

·          class Planet should include:

·          suitable fields as specified above.

·          a constructor to create a planet using suitable parameters

·          accessors to return its planet number, name, luxury rating

·          an ArrayList field to store Permit object references.. (declared and created)

·          mutator ; enter()which has a Permit as a parameter and adds it from the ArrayList

·          mutator leave()which has a Permit as a parameter, finds its position in the ArrayList and then removes using position.

·          an accessor which either says whether the planet is full (reached capacity) (..or still has capacity)

·          method to list all the Permits currently on the planet

·          methods to find and return details of one Permit on the planet

·          an accessor which returns a boolean saying whether a Permit is in the planet (in the ArrayList)

·          a toString () method which includes planet details and a list of the Permits in the planet



We have a new game show that pits three people against each other to find out who can achieve the smallest weight in a given amount of time! The idea is 100% guaranteed original. We want you to help us pick a winner by deciding who's the lightest!






Input






1. The weight of the first competitor






2. The weight of the second competitor






3. The weight of the third competitor






Output






The first line will contain a message prompt to input the weight of the first competitor.





The second line will contain a message prompt to input the weight of the second competitor.





The third line will contain a message prompt to input the weight of the third competitor.





The last line contains the smallest weight of them all.

This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!


Instructions:

  1. Input a 3-digit integer.
  2. Print the largest digit in the integer.
  3. Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.
  4. Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.
  5. Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer.
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS