Java | JSP | JSF Answers

Questions: 3 611

Answers by our 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 & Filtering

What is y after the following switch statement is executed? Rewrite the code using an if-else statement.

x = 3; y = 3;

switch (x + 3) {

case 6: y = 1;

default: y += 1;

}



Write a program to display the days of the week

You are to upload only the .java file

Car repairs An owner of an auto repair shop wishes to organise his team of mechanics at the beginning of the day. To make the distribution of work equal, he organises cars with an even amount of faults into bay 1 and cars with an odd amount of faults into bay 2. There are nine cars in total Write the pseudocode for the problem, then write a Java program to separate the even and odd number of car faults. Have all even numbers displayed first, then odd numbers at the end. The repairs required for each car are as follows. 18, 14, 12, 6, 4, 21, 19, 9, 3 Hint: WHILE LOOPS and IF


Task 2: Internet traffic As a digital business analysist, you have been asked by your line manager to supply the last seven months traffic figures to your company’s website. At the moment, the traffic numbers are not in ascending order. Write the pseudocode to solve the initial problem and then write a Java algorithmic program to sort the array of given traffic figures. The traffic numbers to sort correctly are: 2, -17, 8, 26, 1, 0, 84 Hint: Bubble sort 


Task 1:




Building contractor




You are developer and you wish to build five new houses, all from wood and all uniform.




Each house has 3 rooms, all with exactly the same dimensions, i.e. 2m x 4m. Wood prices




have been set at £6.00 per meter.




You need to determine the total cost of the build of all five houses. Initially, you will need




to write the pseudocode to solve the following problem, define the variable name and data




types, plus write the code to solve the total build cost.




Hint: Determine the area of each room in each house and the total area of all rooms




combined. Thus, giving the total price of the construction. in java





You are given an interface which contains an abstract method and a default method void show()to simply output a statement "This is a default method's output". You need to write a class called MyCalculator which implements the interface. While you will override divisorSum method in MyCalculator class, you need to consider that method just takes an integer as input and return the sum of all its divisors. For example divisors of 6 are 1, 2, 3 and 6, so divisorSum should return 12. The value of n will be at most 1000. You have to create a main class ( any name can be given to main class and in the main class you have to create an object of MyCalculator class using a interface variable of AdvancedArithmetic interface. Then from the main method call the divisorSum method inside a println method using the created object. Then also call the show method using the created object.


Write a program that calculates the area of the following figures:

·        A square of side 0.666666667

·        A rectangle of sides 1/9 and 4

Test the two calculated areas for equality. If the areas are equal output “The area of the two figures are equal” else output “The area of the two figures are not equal”


Develop a Java program to allow computation of student marks in Eng, Math, Chem, Geo, and Physics. The teacher can enter marks for any number of students. He/she can press ‘E’ on the keyboard to stop entering marks. All marks should be stored in an array. When teacher presses E, the program computes and displays total marks, average, highest mark and lowest mark for each student. Use appropriate math functions for average, highest mark, lowest mark, a function which will be called every time the teacher needs to continue putting in marks, and control structures to guide the flow of the program.


Please do this programming activity using the selection statement.




Write a Java program that calculates the total amount due of a student depending on the plan selected and total number of units. To calculate the tuition fee, the cost per unit is 500 pesos. The total miscellaneous fee of all students is 2,000 pesos and other fees costs 378.50 pesos. The following are the types of payment: (a) For cash payment, the total amount due includes the tuition fees, miscellaneous and other fees; (b) Plan A, the total amount due includes he tuition fees, miscellaneous fee, other fees, and additional installment fee of 1,500 pesos; (c)Plan B, the total amount due includes he tuition fees, miscellaneous fee, other fees, and additional installment fee of 2,000 pesos. The program accepts the total units and payment type. The program should print the total tuition fees, miscellaneous fees, other fees, installment fee (if applicable), and total amount due.

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.


LATEST TUTORIALS
APPROVED BY CLIENTS