C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 9, Problem 9.9E
Program Plan Intro

Program Plan:

  • Include the required header files.
  • Create class Date.
  • The class definition will contain prototypes for member function Date like setDate.
  • The private integer members month, day and year.
  • A member function nextDay is included to increment the day by one.

Blurred answer
Students have asked these similar questions
(Combining Class Time and Class Date) Combine the modified Time class of Exercise 17.7and the modified Date class of Exercise 17.8 into one class called DateAndTime. (In Chapter 19, we’lldiscuss inheritance, which will enable us to accomplish this task quickly without modifying the existing class definitions.) Modify the tick function to call the nextDay function if the time increments into the next day. Modify functions printStandard and printUniversal to output the dateand time. Write a program to test the new class DateAndTime. Specifically, test incrementing thetime into the next day.
(Using a Class Without a using Directive) Explain how a program could use class stringwithout inserting a using directive.
(The Fan class) Design a class named Fan to represent a fan. The class contains:■ Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to denotethe fan speed.■ A private int data field named speed that specifies the speed of the fan (the default isSLOW).■ A private boolean data field named on that specifies whether the fan is on (the default is false) ■ A private double data field named radius thatspecifiesthe radius of the fan (the default is5).■ A string data field named color thatspecifiesthe color of the fan (the default is blue).■ The accessor and mutator methodsfor all four data fields.■ A no-arg constructorthat creates a default fan.■ A method named toString() that returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns the fan color and radius along with the string “fan is off” in onecombined string.Draw the UML diagram for the class and…
Knowledge Booster
Background pattern image
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