tubby3229
14.05.2021 •
Computers and Technology
1. In this chapter, the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the member variables. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and year are checked before storing the date into the member variables.
2. Add a member function, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class.
3. The class dateType was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class dateType so that it can perform the following operations on a date, in addition to the operations already defined:
a. Set the month.
b. Set the day.
c. Set the year.
d. Return the month.
e. Return the day.
f. Return the year.
g. Test whether the year is a leap year.
h. Return the number of days in the month. For example, if the date is 3-12-2017, the number of days to be returned is 31 because there are 31 days in March.
i. Return the number of days passed in the year. For example, if the date is 3-18-2017, the number of days passed in the year is 77. Note that the number of days returned also includes the current day.
j. Return the number of days remaining in the year. For example, if the date is 3-18-2017, the number of days remaining in the year is 288.
k. Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3-18-2017 and the days to be added are 25, the new date is 4-12-2017.
Solved
Show answers
More tips
- S Science and Technology How to choose a home theater system?...
- H Health and Medicine Discover the Hidden Principles and Real Results of the Japanese Diet...
- C Computers and Internet Google Search Tips and Tricks: Everything You Need to Know...
- F Food and Cooking Experts Name Top 5 Healthiest Teas...
- F Food and Cooking From Latte to Espresso: Which Coffee Drink is the Most Popular on Earth?...
- F Food and Cooking How many stages of coffee roasting are there?...
- C Computers and Internet Porn Banner: What It Is and How to Get Rid Of It?...
- G Goods and services How to Choose a Coffee Maker? The Ultimate Guide for Coffee Lovers...
- C Computers and Internet How to Teach Older Generations to Work with Computers?...
- P Philosophy Unidentified Flying Object - What is the Nature of this Phenomenon?...
Ответ:
you can install a 64 bit operating system on a 32 bit machine.
hope this helps!