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

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.


1)     You have been asked to implement a user-interface component ButtonCanvas which is both a button that can be clicked by the user and a canvas which the user can draw on. Your existing code contains a Button class and a Canvas class. Both of this extend GuiComponent.

a)     ButtonCanvas should be built using multiple inheritance. What does this mean in this context?                                                                                                (3 marks)

b)     Give two reasons why this might be desirable.                                         (3 marks)

c)     Give two complexities that arise in this case                                             (3 marks)

d)     Java interfaces originally contained only abstract methods and static final fields. How did this restrictions avoid the complexities of extending multiple classes?


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.

Employee of the week


You are provided with the following data set of the employees for a week. The employees are rated on various parameters on the scale of 10. Write a program to help the manager to find on the employee of the week. Create your own logic to define the employee of the week". Please create logic based on the entire week and not just for specific days. Also, clearly state your assumptions


Name


Assessment


Day 1


Day 2


Day 3


Day 4


Day S


Parameters


Attendance


6


4


7


5


5


Peter Parker


3


4


3


5


4


6


4


4


Productivity


Client Feedback


Attendance


Productivity


Client Feedback


8


9


7


6


8


Steve


3


4


8


Rogers


7


7


5


9


Attendance


3


4


6


4


5


Tony Stark


9


19


8


7


7


Productivity


Client Feedback


6


6


6


Sample Input:


Input data will be given in the above table. Assume a way to take input and mention in comments in the program.


Sample Output:


Name of employee.

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS