Create the java source code files for the classes listed

Assignment Help Computer Engineering
Reference no: EM131937092

Problem

Create the Java source code files for the classes listed in the inheritance hierarchy displayed in Figure 10-63a. Create a new Java source code file and enter code for the FinalTest.java test program, as shown in Figure 10-63b on page 686. Compile all source code and execute the test program to obtain the output as displayed in Figure 10-63c on page 686. Perform the following steps to complete these tasks:

1. The abstract base class, Security Alarm, has three constant values used for the state of the alarm: no alarm, sensor failure, and activated alarm. One method, alarm Failure(), cannot be overridden by any subclass. The other two methods, alarm() and sensor Sample(), are abstract.

2. The class, Entry Alarm, inherits from Security Alarm and has a single constant value as a threshold. If the simulation of the alarm sensor exceeds the threshold, the entry alarm is triggered. An Entry Alarm does not fail; it either signals no alarm or it activates an alarm.

3. The class, Fire Alarm, inherits from Security Alarm and has two constant values. One indicates a maximum temperature threshold. If the simulation of the alarm sensor exceeds the threshold, the fire alarm is activated. The other constant indicates a temperature failure threshold, to prevent false alarms. If the simulation of the alarm sensor yields a temperature below this value, the fire alarm has malfunctioned. The source code for this class, FireAlarm.java, is located in the Chapter10 folder on the Student Data Disk.

4. The class, CO Alarm, inherits from Security Alarm and has two constant values. One indicates a maximum carbon monoxide threshold. If the simulation of the alarm sensor exceeds the threshold, the carbon monoxide alarm is activated. The other constant indicates a carbon monoxide failure threshold, to prevent false alarms. If the simulation of the alarm sensor yields a carbon monoxide level below this threshold, the carbon monoxide alarm has malfunctioned.

5. The sensor Sample() method is used to simulate alarm conditions by generating a random number value simulating a sensor reading. If the alarm is activated, this method calls the alarm() method. If the alarm fails, this method calls the alarm Failure() method. Compile all source code and execute the test program to obtain the output as displayed in Figure 10-63c on the next page.

 

1845_Figure 10-63a.jpg

1218_Figure 10-63b.jpg

Reference no: EM131937092

Questions Cloud

What is the project payback period : What is the project payback period if the initial cost is $1,800? (Do not round intermediate calculations. Enter 0 if the project never pays back.
Comment on advantage and disadvantage in using simd computer : Comment on the advantages and disadvantages in using SIMD computers as compared with the use of pipelined supercomputers for vector processing.
Determine the project annual net cash flow : Annual depreciation from the project is $30,000 and the firms tax rate is 40 percent Determine the project annual net cash flow.
Create java source code files to implement a callback method : Create the necessary Java source code files to implement a callback method from two child windows to a parent window, as displayed in Figure 10-64.
Create the java source code files for the classes listed : Create the Java source code files for the classes listed in the inheritance hierarchy displayed in Figure 10-63a.
What is the expected annual amount of electricity : What is the expected annual amount of electricity that the plant will generate, in megawatt-hours?
How would you plan a training program : Assume you are the human resource manager of a small seafood company. The general manager has told you that customers have begun complaining about the quality.
Create an abstract base class animal : Create an abstract base class, Animal. The single constructor requires a String to indicate the type of animal, which then is stored in an instance variable.
How much would you be willing to pay for that security : The required return on security is 10%. how much would you be willing to pay for that security today? Please show work and do not use Excel.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd