Question
Java Part A- (1.45 points) Create a ChemicalReactor Class When the reactor is working it generates heat, hence cooling is provided when the temperature exceeds
Java
Part A- (1.45 points) Create a ChemicalReactor Class When the reactor is working it generates heat, hence cooling is provided when the temperature exceeds 300 degrees. A protection system is in place to shut down the reactor upon extreme increase in temperature or pressure. 1- (0.15 point) Define the following: instance variable: ReactorStatus, is true when the reactor is working. CoolingPump is true when the CoolingPump is activated to cooldown the reactor. Temperature is the reactor temperature. Pressure is the reactor pressure. Class variable: GovermentAgency that captures the name of the agency responsible for monitoring all chemical plants, initiated at NAE. 2- (0.15 points) Create 2 constructors, a default constructor that sets the ChemicalReactor to (true, true, 50, 20) and another constructor that sets all the instance variables using the setters. 3- (0.15 point) Create getters and setters for the instance variables. The setters assure the following: -10 < Pressure < 600, any other values the pressure is considered invalid and set to pressure to 290. -50 < temperature < 500 any other values the temperature is considered invalid and set to temperature to 100. 4- (0.1 point) Create a class method SetAgencyName, that allows setting the GovermentAgeny using a parameter name. 5- (0.2 point) Create a method ProtectionShutDown that protect the reactor, when temperature goes above 400 or pressure goes above 450, the ProtectionShutDown will turn off ReactorStatus (false) 6- (0.2 point) Create a method CoolDown that cools down the reactor by activating the CoolingPump and reducing the temperature by 3.5 degree and pressure by 2 psi. 7- (0.25 points) Create a method ReactorOperating that: Increment the temperature by 1%. Increment pressure by 0.05* temperature. When the temperature is equal to 300 then start cooling down using CoolDown method Use the ProtectionShutDown to make sure than temperature or pressure does not go too high. 8- (0.25 points) Create an equal method that compares a Reactor object to another object and returns true when the 2 objects data matches. Part B- (0.55 points) ChemicalReactor App (0.15 point) Create 2 ChemicalReactor instances, one using the default constructor and the other one uses the other constructor with values of your choice. (0.1 point) Change the first ChemicalReactor object status to true. (0.1 point) Use CoolDown method for cooling the second ChemicalReactor object. (0.1 point) Use the equal method to compare the 2 objects. (0.1 point) Use the class method SetAgencyName to name the government agency NFC.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started