subject

Implement the class Day which represents a day of the week. Put the class definition in the header p1.h and the implementation in the p1.cpp file. You may not have any inline functions defined in the header file. Use the file xercise. cpp to check if your implementation is syntactically correct. Your class has one data members: dayNumber, and int which represents the day of the week (0-6). • The working constructor sets dayNumber appropriately. If the argument is outside of the valid range, throw an invalid argument exception. Make sure that the constructor cannot be called implicitly, • The getDay() accessor returns the dayNumber, • The setDayO) mutator sets the day appropriately, throwing an exception similar to the working constructor if given an inappropriate input value. To save code, you may want to have the working constructor call setDay() so that the exception is only thrown from one place. • The toString() member function returns the full English name of the day of the week. (0 is Sunday, 1 is Monday, etc.). • The overloaded member operator==() returns true if two Day objects are equal. Use the dayNumber to compare them Exam C++ Quick Reference Complete the following files pl. cpp 1 2 3 #include #include #include 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #include "p1.h" 9 10 // Implement your member functions in this file 11 12 pl. 1 #ifndef Pl_H 2 #define Pl_H 3 4 5 #include 6 7 8 // Place your class definition here 9 // 10 11 class Day Les 54 seconds 5 include

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
What is outfitting a workplace with video in a technology
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
You know the right answer?
Implement the class Day which represents a day of the week. Put the class definition in the header p...
Questions
question
Mathematics, 17.05.2021 20:40
question
Biology, 17.05.2021 20:40
question
Mathematics, 17.05.2021 20:40
question
Mathematics, 17.05.2021 20:40
Questions on the website: 13722361