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

Create an application that contains an enumeration that represents the days of the week. Display a list of
the days, and then prompt the user for a day. Display business hours for the chosen day. Assume that the
business is open from 11 to 5 on Sunday, 9 to 9 on weekdays, and 10 to 6 on Saturday. Save the file as
DayOfWeek.java.
Create a class named Majors that includes an enumeration for the six majors offered by a college as follows:
ACC, CHEM, CIS, ENG, HIS, PHYS. Display the enumeration values for the user, and then prompt the
user to enter a major. Display the college division in which the major falls. ACC and CIS are in the
Business Division, CHEM and PHYS are in the Science Division, and ENG and HIS are in the Humanities
Division. Save the file as Majors.java.

Flow control is one of the main building blocks that determines how a program should run. Ghana Cocoa Growing company wishes to compare the impart of two newly acquired fertilizers on cocoa. They will do this by applying the same quantity of the two fertilizers on two similar but different cocoa plant under the same conditions (humidity, sunlight, soil moisture etc.). They will then choose the fertilizer whose crop produces the best harvest (highest quantity per square feet). As a programmer, 

c. create a method that takes four arguments i.e. (the names of the two fertilizer and their individual yields). The methods should return the name of the fertilizer with the greatest yield.  

    

d. Using “c” above, write a program that request for two fertilizer name and their respective yields. Your program should display the fertilizer with the most yield   

e. Discuss your answer in “d” above


Problem 5: 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)


D is hosting a lunch and R is incharge of the sitting plan D’s dining table is an infinite row of seats with D at one end. Each of D’s guests represents a alphabet (a to z). D want guests to be seated such that the resulting string formed from the alphabets is smallest He didn’t tell total number of guests.

The rules:-

● Seats are allotted in sequential order, a guest who arrives later must be further from D

● An incoming guest must be assigned a seat, as soon as he arrives

● Once a guest take seat, you can’t ask them to move to some other seat.Even if

the seat in front of him is empty.

● But you can make a guest disappear, D has allowed to make at most k of his guests disappear but you can’t remove more than k guests.

● No seat should remain empty b/w any 2 guests or b/w guest and D, a series of empty seats would be in the end. You are R, design a code using an efficient data structure that will follow to keep track of which guest to assign which seat.


Flow control is one of the main building blocks that determines how a program should run. Ghana Cocoa Growing company wishes to compare the impart of two newly acquired fertilizers on cocoa. They will do this by applying the same quantity of the two fertilizers on two similar but different cocoa plant under the same conditions (humidity, sunlight, soil moisture etc.). They will then choose the fertilizer whose crop produces the best harvest (highest quantity per square feet). As a programmer, 

 

a. Suggest a flow control method that would be used to do the comparison and explain the reason why you chose it.   

b. Write a flow control statement that would do the comparison in “a” above. 



Problem 3: 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 (assume 50% probability for each min or max). Beta: He will choose a ‘k’ and will call the kth smallest ID, (Kth ID when all IDs are arranged in ascending order). K is chosen randomly from the number of persons available in waiting area (1 <= K <= Total persons)


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. 


LATEST TUTORIALS
APPROVED BY CLIENTS