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

come up with an example of a *class hierarchy* of at least 2 classes you argue would be needed for an application of your choice.


Write a function:

class Solution { public int solution (int[] A); }

that, given an array A consisting of N integers, returns the sum of all integers which are multiples of 4.


Design an Employee class for reading and displaying employee information, the getInfo() and displayInfo() methods will be used respectively. Where getInfo() will be a private method. Used the Concept of Encapsulation to hide the data members, Employee Consist four data members. 



  Write a program using class ‘Math’ pass three values as arguments to the constructor of the class and initialize these values to data members x,y and z of the class. The class should have following member functions.

·        maximum       : return maximum number 

·        minimum        : return minimum number

·        sum                : return the sum of three numbers



  Write a program using class ‘Rectangle’ to compute the area and perimeter of rectangle. The Class rectangle should have the following members:

·        Two data members’ length and width.

·        One member function ‘setData’ to assign values to data members ‘length’ & ‘width’. It should also verify that length and width between 0.0 and 25.0 

·        One member function ‘area’ to compute and print the area of rectangle.

Area =length * width

·        One member function ‘perimeter’ to compute and print the perimeter of rectangle.

Perimeter =2*(length * width)



Write a program using class ‘FindEnergy’ to compute the Potential Energy and kinetic Energy of an object. The class FindEnergy should have following members.

• Four data members mass, height, velocity and gravity (9.8m/s2) take gravity as Constant.

• One member function ‘setInputData’ to assign values to data members.

• One member function ‘potentialEnergy’ to compute. And return the Potential Energy.

HINT: P.E=mgh

• One member function ‘kineticEnergy’ to compute. And return the Kinetic Energy.

HINT: K.E=1/2 mv2


Give an example of a while loop, then provide the equivalent do-while loop and for loop. Then give a different example of a do-while loop, along with the equivalent while loop and for loop. Finally, give an example of a for loop, along with the equivalent while loop and do-while loop. Use your examples to illustrate the advantages and disadvantages of each looping structure, and describe those advantages and disadvantages.


In the character class main method, implement code to demonstrate applying the above classes as follows: (a) Declare a Character reference variable and create one of your custom character objects to store in it (b) Create an Item object for use by the character (c) Simulate the character receiving and using the item by calling character class method.

Make UML diagrams for your character class and item class, including fields


Write a class in java to get the name of Student and marks of three subjects. Calculate the total marks and average marks. Each subject has a maximum of 100 marks.


Question: Use your own theme to make your own class design and implementation unique, giving the character unique attributes and actions.

 Implement a main game character object oriented class type to simulate what is common to all characters in your game

A class data field (variable) (data member) to represent the name/identifier of the character/ make sure each character can carry an item


LATEST TUTORIALS
APPROVED BY CLIENTS