array 3cstring 2c 7 3e c 2b 2b

Solutions on MaxInterview for array 3cstring 2c 7 3e c 2b 2b by the best coders in the world

showing results for - "array 3cstring 2c 7 3e c 2b 2b"
Alina
06 Sep 2017
1//dayType.h, the specification file for the class dayType
2#include <iostream>
3#include <string>
4using namespace std;
5
6class dayType{ 
7private:
8	
9	
10	string day; // To hold single instance of the name of a weekday.
11
12	const string dayName[7]; // holds the names of the of the seven weekdays
13		//"Sunday", "Monday", "Tuesday", "Wedensday", "Thursday", "Friday", "Saturday"
14
15	int dayNumber; // To hold an int representation of the location of a spicific day 
16	    //within the array
17	
18	void setDay(); // Function to set the DayType variable "day" to the name of a 
19		//weekday. This function recieves a call from promptUser() and begins by asking 
20		//the user to enter the day to set. 
21		//Postcondition: after the user enters the information in the form of a 
22		//weekday name this function sets the day to that value.
23public:
24
25	void promptUser(); // Asks the user if they want to set the day and if yes 
26		//prompts the user to set the day by entering the day name via function setDay.
27		//Postcondition: If the user chooses to enter Y for yes when prompted this 
28		//function calls setDay() 
29