subject
Computers and Technology, 21.07.2020 05:01 emocow

Write a program that contains a class that implements the day of the week. Create a class called DayOfTheWeek. The class should have a single data member that can store the day of the week such as Mon for Monday, Tues for Tuesday etc...
The program should be able to perform the following on an object of the class.
1. Set the day
2. Print the day
3. Return the day
4. Return the next day
5. Return the previous day
6. Calculate and return the day by adding a certain amount of days to the current day. For example if you add 5 days to Saturday, the day to be returned is Thursday. Likewise, if we add 12 days to Wednesday, the day to be returned is Monday.
Call these functions setDay, printDay, getDay, plusOneDay, minusOneDay, and addDays. Create the necessary member functions that will perform the required operations outlined above.
Write a main program that will instantiate two objects of the class dayOfTheWeek. Create one object using default constructor and the other using overloaded constructor. Use these objects to test the various operations on this class. Use your own test data.
Use multiple files to accomplish this lab such as week. h, week. cpp, & weekMain. cpp.
Create a zip file containing the above files along with the output file.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:20
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 23.06.2019 00:50
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
question
Computers and Technology, 23.06.2019 01:50
Free points just awnser this. what should i watch on netflix
Answers: 2
You know the right answer?
Write a program that contains a class that implements the day of the week. Create a class called Da...
Questions
question
Health, 24.05.2021 17:40
question
Computers and Technology, 24.05.2021 17:40
question
Mathematics, 24.05.2021 17:40
Questions on the website: 13722360