Question: Java - create a class standing desk, that models in office standing desk that can be lowered and raised to a comfortable heights. Use the

Java- create a class standing desk, that models in office standing desk that can be lowered and raised to a comfortable heights. Use the attached project to import the given test class for your solution(picture attatched & written after prompt). Your solution needs to include the following: a constructor that accepts an initial height. Getters for current initial height. A raise method to change the current height upward. A lower method to change the current height downward. A reset method to bring the desk back to the initial height. Two consents to present the maximum height of 50 cm and the minimum height of 25 cm this would represent the upper and lower height range possible.
Java Test Class:
package desk;
public class TestStandingDesk {
public static void main(String[] args){
StandingDesk desk1= new StandingDesk(32.0):
pxintDesk (desk1):
desk.1 raise(5.0);
printDesk (desk1);
desk. .1ower(50.0);
printDesk (deskl);
desk1.reset():
pxintDesk (desk1);
desk:1.1ower(5.0):
printDesk(desk1):
3
/**
Print the initial height and the current height of the desk to stdout:
Gparam desk
*/
pxivate static Iinal void printDesk(StandingDesk desk){
System,ont.print1n("Desk min height="+ desk.getinitialkeight()+
", desk current height="+ desk.getkeight()):
3
Java - create a class standing desk, that models

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!