+1(316)4441378

+44-141-628-6690

Mars

It is the year 2030, the MarsX Space Vehicles Company is in the process of designing its X-2 single use Space Transportation Systems (STS).  You have been tasked with creating a class to model a single STS.

Design a class named STS (Space Transportation System) that contains:
1.    A private int data field named STSId for the STS registration ID.
2.    A private Date data field named dateCreated that stores the date when the STS was created.
3.    A private double data field named emptyMass in pounds (default to 613,100) which represents the mass of the STS before fueling.
4.    A private double data field named fuelMass in pounds (default to 3,785,000) which represents the mass of the fuel needed by the STS.
5.    A private double data field named payloadMass in pounds (default to 0) which represents the mass of the STS payload.
6.    A private double data field named totalMass which represents the mass of the STS after it has been assembled in the launchpad fully fueled (emptyMass + fuelMass + payloadMass).
7.    A private String data field named manufacturer that stores the name of the company that built the STS (default MarsX). Assume all STSs have the same manufacturer.
8.    A private int data field flightTime in seconds (default to 0).
9.    A no-arg constructor that creates a default STS and initializes the STSId with a 5 digit random integer and the date when the STS was created.
10.    A two-argument constructor that creates an STS with a specific initial fuel mass and payload mass (constructor arguments) and also initializes the STSId with a 5 digit random integer and the date when the STS was created.
11.    The accessor (get) and mutator (set) methods for manufacturer, fuelMass and payloadMass
12.    The accessor (no mutator) methods for flightTime, emptyMass, totalMass, STSId and dateCreated.
13.    A method named increseFlightTime() that increases the flight time by 5 seconds. The STS burns through 1% of its fuel for every second of flight (up to the original fuelMass).
14.    A method named deployPayload() that deploys the payload in space (mass will be affected). The STS takes 200 seconds to get to space. It cannot deploy its payload before that. Show error message if this method is called before the STS gets to space.
*Provide appropriate input validation for these methods. Print a message to the console if the arguments passed to the method do not pass the validation test(s).

Write a test program (class TestSTS) that creates an STS object and tests every method of the class. (use console output).

 

You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.

 

Latest completed orders:

# topic title discipline academic level pages delivered
6
Writer's choice
Business
University
2
1 hour 32 min
7
Wise Approach to
Philosophy
College
2
2 hours 19 min
8
1980's and 1990
History
College
3
2 hours 20 min
9
pick the best topic
Finance
School
2
2 hours 27 min
10
finance for leisure
Finance
University
12
2 hours 36 min
[order_calculator]