1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
luda_lava [24]
3 years ago
14

A date consists of a month, day, and year. Consider the class Date of such dates. Suppose that Date represents the month, day, a

nd year as integers. For example, July 4, 1776, is month 7, day 4, and year 1776. a. Write specifi cations for a method within Date that advances any given date by one day. Include a statement of purpose, the preconditions and postconditions, a description of the arguments, and a description of any return value. b. Write a C++ implementation of this method. Design and specify any other method that you need. Include comments that will be helpful to someone who will maintain your implementation in the future.
Computers and Technology
1 answer:
Dominik [7]3 years ago
4 0

Answer:

#include <iostream>

#include <cmath>

using namespace std;

class Date

{

public:

Date ();

Date ( int mn, int day, int yr); // constructor

void display(); // function to display date

int GetMonth();

void SetMonth(int mn);

~Date();

private:

int month, day, year;

};

// constructor definition

Date::Date ()

{

month = day = year = 1;

}

Date::Date (int mn, int dy, int yr)

{

static int length[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

month = mn;

day = dy;

year = yr;

}

void Date::display()

{

static string name[] = {"nothing", "January", "February", "March", "April",

"May", "June", "July", "August", "September", "October",

"November", "December" };

cout << '\n' << name[month] << ' ' << day << "," << year << '\n';

}

Date::~Date()

{

cout << "Thank You for using DateLine Services and have a nice date\n";

}

int Date::GetMonth()

{

return month;

}

// Precondition: 1 <= mn <= 12

void Date::SetMonth(int mn)

{

month = mn;

}

int main()

{

Date mydate(1, 2, 1993);

Date date2(4,12,1994);

Date date3;

mydate.display();

date2.display();

date3.display();

}

Explanation:

You might be interested in
With a DUI charge on a driver’s record A. the price of his/her insurance greatly increases. B. he/she may drive only during day
Dmitry_Shevchenko [17]
D. Choice 1 and Choice 3 :)
6 0
3 years ago
Read 2 more answers
Which feature of presentation software is located under the Insert tab?
blondinia [14]

Answer:

Shapes

Explanation:

7 0
3 years ago
Read 2 more answers
What process combines data from a list with the content of a document to provide personalized documentsWhat
Morgarella [4.7K]
Mail merge can combine data with the content of a document to make personalized documents.
6 0
3 years ago
Read 2 more answers
A single line text input control with an initial value as +971
Nezavi [6.7K]

Answer:

What's about this initial value equal to 971

Explanation:

\sqrt{2}

8 0
3 years ago
Question 19 :A user needs the video capability in his computer upgraded to support a new graphics application. The computer incl
elena-s [515]

Answer:

The onboard video card should be disabled in the BIOS. After you disable the onboard video card in the BIOS, it will no longer function.

Explanation:

Since in the question a user wants to upgrade for new graphics application and also the computer involves the onboard video card and a new video card is installed in the computer now you want to disabled it

So this can be done in the BIOS i.e basic input output system which is to be used for rebooting the computer system

And after disabled it, you cannot used.

3 0
3 years ago
Other questions:
  • Which resource helps a user access a cloud service?
    13·2 answers
  • Under which menu option of a word processing program does a star appear
    9·2 answers
  • What piece of software tells the operating system how to use a specific hardware device? a. User interface b. System service c.
    14·1 answer
  • When typing a cell, hitting Tab will bring which result?
    12·1 answer
  • Which of the following is the correct financial function that returns the periodic payment for a loan?
    10·1 answer
  • Write convert() method to cast double to int
    7·1 answer
  • Anyone else 17 and still plays rblox xd?
    8·2 answers
  • Subratract 11100 from 1011 by using 1's complement method step by step​
    6·1 answer
  • 1. List three tabs that make up the Ribbon
    14·1 answer
  • Taking control of admin functionality and misusing sensitive data that are unauthorized to access are due to.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!