Absolute Java (6th Edition)
Absolute Java (6th Edition)
6th Edition
ISBN: 9780134041674
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 7, Problem 4PP

Define a class called Administrator, which is a derived class of the class SalariedEmployee in Display 7.5. You are to supply the following additional instance variables and methods:

An instance variable of type String that contains the administrator's title (such

as "Director" or "Vice President").

An instance variable of type String that contains the administrator's area of responsibility (such as "Production", "Accounting", or "Personnel").

An instance variable of type String that contains the name of this administrator's immediate supervisor.

Suitable constructors, and suitable accessor and mutator methods.

A method for reading in an administrator's data from the keyboard.

Override the definitions for the methods equals and tostring so they are appropriate to the class Administrator.

Also, write a suitable test program.

Blurred answer
Students have asked these similar questions
2019 AP® COMPUTER SCIENCE A FREE-RESPONSE QUESTIONS 2. This question involves the implementation of a fitness tracking system that is represented by the StepTracker class. A StepTracker object is created with a parameter that defines the minimum number of steps that must be taken for a day to be considered active. The StepTracker class provides a constructor and the following methods. addDailySteps, which accumulates information about steps, in readings taken once per day activeDays, which returns the number of active days averageSteps, which returns the average number of steps per day, calculated by dividing the total number of steps taken by the number of days tracked The following table contains a sample code execution sequence and the corresponding results. Statements and Expressions Value Returned Comment (blank if no value) StepTracker tr StepTracker(10000); Days with at least 10,000 steps are considered active. Assume that the parameter is positive. new tr.activeDays () ; No…
In the board game Scrabble, each tile contains a letter, which is used to spell words in rows and columns, and a score, which is used to determine the value of words. The point of this exercise is to practice the mechanical part of creating a new class definition: Write a definition for a class named Tile that represents Scrabble tiles. The instance variables should be a character named "letter" and an integer named "value". Write a constructor that takes parameters named letter and value, and initializes the instance variables. Create getters for both of the attributes. (No setters, so that a Tile is immutable.) Implement the .toString() and .equals methods for a Tile. Your completed Tile class should work with this Main program (Links to an external site.) so that it produces sample output like shown at the end of the program. You can Fork the program to make your own version in Replit, where you can add your Tile.java, or you can copy the program to your own Java development…
1. Create a class called Elevator that can be moved between floors in an N-storey building. Elevator uses a constructor to initialize the number of floors (N) in the building when the object is instantiated. Elevator also has a default constructor that creates a five- (5) storey building. The Elevator class has a termination condition that requires the elevator to be moved to the main (i.e., first) floor when the object is cleaned up. Write a finalize() method that satisfies this termination condition and verifies the condition by printing a message to the output, Elevator ending: elevator returned to the first floor. In main(), test at least five (5) possible scenarios that can occur when Elevator is used in a building with many floors (e.g., create, move from one floor to another, etc.). Hint: Termination occurs when the instance is set to null. You may wish to investigate “garbage collection” for this exercise.

Chapter 7 Solutions

Absolute Java (6th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY