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

Have you ever answered a test question that tells you to enumerate a series of things, but the answer must be in a sentence? Quite tiring to write those things separated by commas and a single space, isn't it?

Then let's try coding it instead!


Write the code of a class named EXAM with following description. (10 marks)

Private Members;

1. exmCode of type string, 6 characters.

2. exmDescription of type string, 40 characters.

3. noCandidate of type integer.

4. centersReqd (number of centers required) of type integer.

5. A member function CALCNTR( ) to calculate and return the number of

centers as (noCandidates/100+1).

Public Members;

1. A function SCHEDULE( ) to allow user to enter values for exmCode,

xmDescription, noCandidate and call function CALCNTR( ) to calculate the

number of centers.

2. A function DISPXM( ) to allow user to view the content of all the member data.


The first step in RMI is to write and compile the Java code for the service interface. The Calculator interface defines all of the remote features offered by the service. The code in Figure 1 shows the interface of a calculator. Write the implementation for the remote service by using the class name CalculatorImpl. 



Write the code of a class named EXAM with following description

Private Members;

1. exmCode of type string, 6 characters.

2. exmDescription of type string, 40 characters.

3. noCandidate of type integer.

4. centersReqd (number of centers required) of type integer.

5. A member function CALCNTR( ) to calculate and return the number of

centers as (noCandidates/100+1).

Public Members;

1. A function SCHEDULE( ) to allow user to enter values for exmCode,

xmDescription, noCandidate and call function CALCNTR( ) to calculate the

number of centers.

2. A function DISPXM( ) to allow user to view the content of all the member data.

(The functions should be prototyped within the class and their definitions placed

outside the class)


The square of an integer refers to the result of multiplying the integer with itself once. While the cube of an integer refers to the result of multiplying the integer with itself twice. As long as you know that, you could easily solve this!


Instructions:

  1. Input three integers and compute the cubes of each of them.
  2. Check if the sum of the cubes are positive. If it is, print out "Positive", and if not, print out "Negative".

Write a program that reads in a set of positive integers and outputs how many times a particular number appears in the list. You may assume that the data set has most 7 numbers


The numbers must be output in increasing order for example:



15​40​28​62​62​15​28

Create a JMenubar and its two JMenuS as follows: a. Private JMenuBar mainBar = new JMenuBar(); b. Private JMenu mainBar = new JMenu (\u201cFile\u201d); c. Private JMenu mainBar = new JMenu (\u201cDepartments\u201d); 3. Create the items that will appear within the menus. The File menu contains an Exit option. The Departments menu contains three submenus: ICT, THM, EDUCATION. Each of those submenus contains more options. a. ICT contains: Information Technology, Information Systems, and Associate Computer Technology b. THM contains: Hospitality Management and Tourism Management c. EDUCATION contains: Major in Math, Major in English, Major in MAPEH, and Major in Filipino. 4. If you select items in Departments Menu, change the following background: a. IT: BLUE b. IS: GREEN c. ASCT: YELLOW d. HM: PINK e. TM: WHITE f. Major in Math: RED g. Major in English: CYAN h. Major in MAPEH: VIOLET i. Major in Filipino: MAGENTA\n"}]}


Define an abstract base class SHAPE that includes protected data members for the (x,y) position of a shape, a public method to move a shape , and a public abstract method show() to output a shape .Derive subclasses for lines, circles and rectangles. Also define the class POLYLINE with SHAPE as the base class. You can represent a line as two points, a circle as a center and a radius. A rectangle as two points on diagonally opposite corners. Implement the toString() method for each class. Test the classes by selecting ten random objects of the derived classes, then invoking the show() method for each class. Use the toString() method in the derived classes.  


Create a class to print the area of a rectangle. The class has two methods with the same name but different number of parameters. The method for printing area of rectangle has two parameters which are length and breadth.


Create a class called computers and two classes MyComputer and YourComputer which inherits computer class. Define appropriate fields for the three classes. Create another class processor as a composite class of computer. Write a method which prints the differences between the processors of two computers.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS