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

In the country of WeirdLand, there is only one barber shop. In the shop there are 3

barbers, Alpha, Beta and Gamma, who are not always efficient as employees. All the customers are seated in a waiting area, each customer has a card which has a unique integral ID. For calling next person from the waiting area each barber has his own weird way:

Alpha: He will call either the person with least ID from the waiting area of the one with max ID. Min or Max is decided randomly by him

Beta: He will call the kth smallest ID, (Kth ID when all IDs are arranged in ascending order). K is chosen randomly(1 <= K <= Total persons)

Gamma: He will always choose the median ID. If there are ‘n’ people in the waiting area, the median will be defined as (n+1)/2 th ID when all of them are arranged in ascending order. (For both odd and even ‘n’ )

Your task is to design a data structure which should support the query of each of the three

barbers. The data structure should be highly efficient.


  1. Samantha and Vikas are looking to buy a house in a new development. After looking at various models the three models they like are colonial, split-entry, and single-story. The builder gave them the base price and the finished area in square feet of the three models. They want to know the price per square foot of the three models and the model with the least price per square foot. Write a program that accepts as input the base price and the finished area in square feet of the three models. The program outputs the price per square foot of the three models and the model with the least price per square foot.


hoping for answer im so glad this website is make.i shared it on my friend


  1. have several pictures of different sizes that you would like to frame. A local picture framing store offers two types of frames—regular and fancy. The frames are available in white and can be ordered in any color the customer desires. Suppose that each frame is 1 inch wide. The cost of coloring the frame is $0.10 per inch. The cost of a regular frame is $0.15 per inch and the cost of a fancy frame is $0.25 per inch. The cost of putting a cardboard paper behind the picture is $0.02 per square inch and the cost of putting glass on top of the picture is $0.07 per square inch. The customer can also choose to put crowns on the corners, which costs $0.35 per crown. Write a program that prompts the user to input the following information and then output the cost of framing the picture: 

a. The length and width, in inches, of the picture. 

b. The type of the frame. 

c. Customer’s choice of color to color the frame. 

d. If the user wants to add the crowns, then the number of crowns. 


How do we provide security to RMI classes? Write a program to implement Simple Student database application using RMI. Remote client consist of GUI for performing different database operations (For ex. Insert, delete, update) and retrieving data through RMI.


Regular service: $10.00 plus first 50 min. are free. Charges for over 50 min. are $0.20 per minPrem. service: $25.00 plus: calls made from 6:00 a.m. to 6:00 p.m., the first 75 min. are free; charges for over 75 minutes are $0.10 per mincalls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges for over 100 minutes are $0.05 per minprogram should prompt the user to enter an account num, a service code (type char), and the number of minutes the service was used. A service code of r or R means regular service; a service code of p means prem service. Treat any other character as an error. Your program should output the account number, type of service, number of min. the telephone service was used, and the amount due from the user. For the premium service, the customer may be using the service during the day and the night., to calculate the bill, you must ask the user to input the number of min the service was used during the day and the number of minutes the service was used during the night.


  1. The number of lines that can be printed on a paper depends on the paper size, the point size of each character in a line, whether lines are doublespaced or single-spaced, the top and bottom margin, and the left and right margins of the paper. Assume that all characters are of the same point size, and all lines are either single-spaced or double-spaced. Note that 1 inch ¼ 72 points. Moreover, assume that the lines are printed along the width of the paper. For example, if the length of the paper is 11 inches and the width is 8.5 inches, then the maximum length of a line is 8.5 inches. 


Write a program that calculates the number of characters in a line and the number of lines that can be printed on a paper based on the following input from the user: 

a. The length and width, in inches, of the paper. 

b. The top, bottom, left, and right margins. 

c. The point size of a line. 

d. If the lines are double-spaced, then double the point size of each character.





COVID-19 has triggered panic buying from Ghanaians with the expectation
that there will be declaration of lockdown after the closure of school across the
country. Retailer are increasing the prices of their goods on the shelf based on
the time it stays on the shelf. The management of “Brutus Stores” have decided on this price policy. The price of any item which is expected to sell within a
week should be increased by 20%. However, if an item stays on the shelf after a week but less than or equal to two weeks the price should be increase by 15%. The price of any other item that stays on the shelf for more than two weeks should be increase by 2%. As a programmer you have been consulted to
develop a program that will:

a. Request for item name, current price in GHc, expected duration on shelf
b. Compute the retail price of the item
c. Display the results
d. Explain your results

Suppose that overSpeed and fine are double variables. Assign the value to fine as follows: If  0 < overSpeed <= 5, the value assigned to fine is $20.00; if 5 < overSpeed <= 10, the  value assigned to fine is $75.00; if 10 < overSpeed <= 15, the value assigned to fine is  $150.00; if overSpeed > 15, the value assigned to fine is $150.00 plus $20.00 per mile over  15.

There is a binary tree given to you. In which each of the node represents the student in the class.

You are playing a game in which you need to team up with one of student in class. Team can be

formed in such a way that in a team both of the students can’t have same parent in tree and should

be at the same level in binary tree.


Input: we have given you some pair of students you need to find that is the team valid or not.

Output: ‘Yes’ if the team is valid or ‘No’ if the team is invalid.

(a) Optimal solution of O(n) for checking the team validity.

(b) How many tree traversal is required for the solution of the above problem.

Marking Scheme: Total 15 marks-> 10 for part (a)( Algorithm explanation + Pseudo-code +

runtime and data structure used)+ 5 for part (b)(explanation is required)


Suppose there is a list s1->s2->s3->.........->sn-1


->sn. given to you. You need to modify this list in


such a way that it will be s1->sn

->s2->sn-1

->s3->sn-2.......


Note: algorithm should be inplace without modifying the values of the nodes.

Marking Scheme: Total 10 marks ( Algorithm explanation + Pseudo-code + runtime and data

structure used)


LATEST TUTORIALS
APPROVED BY CLIENTS