C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Question
Book Icon
Chapter 10, Problem 7PE
Program Plan Intro

Program Plan:

  • Declare a class dayType to store a day and to check the day number is valid or not. If it is valid, then go to the next function. Otherwise print the message "Day number should be in between 0 and 6."
  • Implement the main function that tests all constructors and functions in the class dayType.
  • Implement set function that accepts a day as a parameter then verifies whether the day is valid and sets that day as the current day.
  • Implement print function that accepts a day as an integer parameter and displays that day as a string.
  • Implement getDay function that returns the current day as an integer.
  • Implement next_day function that returns the next day to the current day as an integer.
  • Implement prev_day function that returns the previous day to the current day as an integer.
  • Implement a default constructor that sets 0 to the current day as Sun (Sunday).
  • Implement parameterized constructor that sets the specified day to the current day.

Program Description: The purpose of the program is to implement the days of the week. It stores the day such as Sunday and it performs the specified operations.

Blurred answer
Students have asked these similar questions
Show all the work
Construct a frequency polygon density estimate for the sample in Question 1, using bin width determined by Sturges’ Rule.
Show all the work
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
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage