Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

Write a program that prompts the user to enter five integers that you store in an array. Write a function called quadruple() that takes a single-integer parameter and multiplies it by 4, returning the result to the calling program. Call the function once for each of the five integers, then display the quadrupled results from within the main() function.
Create a class named Car. The Car class contains a static integer field named count. Create a constructor that adds 1 to the count and displays the count each time a Car is created. Create a destructor that subtracts 1 from the count and displays the count each time a Car goes out of scope. Write a main() function that declares an array of five Car objects. Output consists of five constructor messages and five destructor messages, each displaying the current count.
Create two classes DM and DB to store the value of distances.DM stores distances in meters and centimetres and DB in feet and inches. Write a program that can read values for the class object and add one object of DM with another object of DB. Use a friend function to carry out the addition operation. The object that stores the results may be a DM or DB object depending on the units in which the results are required. Type display should be in feet-inches or meter-centimetre depending on the object of display.

Question )  Implement an object oriented ’Character’ class to capture the common attributes and actions of all characters in your game.

Code) Read input from the keyboard to let the user provide values for your character’s attributes of a specific character object (not a superclass object) your code will create.

Code)  Since the user could mistype or introduce problems with their typed input, handle all exceptions with exception handling as part of your character data gathering code.

Code) Create a superclass character object, and call its attack method to demonstrate its use 



1)  Implement an object oriented subclass of Character, to simulate a specific kind of character in your game. For example, a ’warrior’ class. A warrior is a character, but a character is not necessarily a warrior.

2)  Include one unique data field for an attribute of the specific character that is not inherited or defined in Character class

3) Implement a method which overrides the Character attack method to make your subclass simulate a more specific kind of attack that relates to its type, with informative printouts


1) Implement an object oriented ’Character’ class to capture the common attributes and actions of all characters in your game. No need to make this class or the subclass public.

2) Declare two data fields for attributes of the character, one textual and one numeric.

3) Implement a constructor method to initialize data fields and set up the character object .

4) Since all characters can attack, implement a method to simulate the character object attacking in some generic way, including informative printouts


Create a Student class with instance variables name, roll, mark and instance methods setStudentDetails(), displayStudent(). One object of the Student class represents a specific student. Create a Singly Linked List in such a way that every node of the Linked List contains 2 parts: stud and link, where, stud stores the reference to a Student object and link stores the reference of the next node. Hence, the Node class (user defined type) has the following structure.


Briefly explain what an array is. As part of your answer make use of a labelled example to show the declaration and components of an array Note: You will receive 4 marks for your explanation and 6 marks for your labelled example.


dentify the purpose and the components of the method represented in the pseudocode below:


Consider the following pseudocode, then write the pseudocode for mainline logic that contains the elements required in Q.4.3.1 to Q.4.3.3.


LATEST TUTORIALS
APPROVED BY CLIENTS