C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 17, Problem 17.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.
  • Declare private integer members month, day and year.
  • A member function nextDay is included to increment the day by one.

Program Description:

The following program is combination of class Time and Date from exercise 17.7 and 17.8. It has the class DateAndTime which declares the functions DateAndTime(), setTime(), setHour()and setMinute(). Including a tick()member function that increments the time and nextDay() function that increments the day.

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.
(The Person, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and e-mail address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, and date hired. Use the MyDate class defined in Programming Exercise 10.14 – see the textbook - to create an object for date hired. A faculty member has office hours and a rank. A staff member has a title. Override the toString method in each class to display the class name and the person's name. Draw the UML diagram for the classes and implement them. Write a test program that creates a Person, Student, Employee, Faculty, and Staff, and invokes their toString() methods.
C++ programming Language Write a program that converts a number entered in Roman numerals todecimal form. Program should consist of a class, say romanType. Anobject of romanType should do the following:a. Store the number as a Roman numeral.b. Convert and store the number into decimal form.c. Print the number as a Roman numeral or decimal number as requested by the user. (Write two separate functions—one to print the number as aRoman numeral and the other to print the number as a decimal number.)The decimal values of the Roman numerals are:M 1000D 500C 100L 50X 10V 5I 1Remember, a larger numeral preceding a smaller numeral means addition,so LX is 60. A smaller numeral preceding a larger numeral means subtraction, so XL is 40. Any place in a decimal number, such as the 1s place, the10s place, and so on, requires from zero to four Roman numerals. (The program must include implementation files, .cpp and .h )
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education