subject

Design a base class, Road, with the following members: .
Attributes for storing the road's name, number of lanes, and maximum speed limit.
A three-parameter constructor to initialize the three attributes
Accessors and Mutators (Gets and Sets) for each attribute.
Input Validation: You should ensure that the number of lanes is always a value greater
than 0, and that the maximum speed limit is a value between 0 and 100 MPH. This input
validation should apply to both the 3-parameter constructor and the individual accessor
functions
A display function that prints the road's information in a single line format

Design a derived class, TollRoad, which inherits from Road. It should have the following members:
.
An attribute for storing the toll for using the road.
A 4-parameter constructor to initialize the three attributes of the base class, as well as
the toll
Accessor and Mutator methods for the toll.
Input Validation: You should ensure that the toll is a value greater than 0.0. This validation
should apply to both the 4-parameter constructor as well as the individual accessor
An overridden display function that displays the information of the TollRoad in a two-line
format, where the first line displays basic Road information, and a second line specifies
the current toll

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, abbygriffin2009
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
image
Computers and Technology, 22.06.2019 19:10, kaiya789
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
image
Computers and Technology, 22.06.2019 20:40, wutdmgamerz
Assume that there is a 4% rate of disk drive failure in a year. a. if all your computer data is stored on a hard disk drive with a copy stored on a second hard disk drive, what is the probability that during a year, you can avoid catastrophe with at least one working drive? b. if copies of all your computer data are stored on three independent hard disk drives, what is the probability that during a year, you can avoid catastrophe with at least one working drive?
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, nayo2006
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
You know the right answer?
Design a base class, Road, with the following members: .
Attributes for storing the road's na...

Questions in other subjects:

Konu
History, 11.12.2019 19:31
Konu
History, 11.12.2019 19:31