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
Brianna is taking a backpacking trip in the wilderness and wants to back up the photos from her camera. Which type of storage de
Katen [24]

Answer:

<u><em>C</em></u>

Explanation:

Flash drives usually have an input (E.G. one of those android charger connectors), so just plug that into your camera, and load the flash drive with the photos. Then go home and plug the USB on the flash drive into your PC. If there isn't already, a folder will be made in your "Pictures" folder on your PC, to which you can open the folder, and then your photos should be there. From there you can open them, print them, etc.

Hope this helped, and sorry if I didn't answer in time.

6 0
3 years ago
How to get points on Brainly?<br> List at least two ways if you can.
GarryVolchara [31]

Answer:

1. Answering questions

2. Logging in everyday

Explanation:

By answering questions, you will earn points. By logging in everyday, I think they give you points as well. Good luck, and hope this helped! :-)

6 0
3 years ago
Read 2 more answers
If all of Earth's history were squeezed into one 12-hour period, how long ago did Precambrian time end? How long did the Cenozoi
Jet001 [13]

Answer:

That it

Explanation:

There have been mass extinctions during the Cenozoic as there were during the Mesozoic and Paleozoic, but not as many animals and plants have disappeared. Finally, humanity appeared during the last two million years.The human lineage only diverged from our most recent common ancestor about 5 million years ago; less than half of 1% of that time, and modern Homo sapiens is only between 200,000 and 50,000 years old, depending on your definition.

7 0
3 years ago
Which of the following Information Technology career fields generally requires the lowest level of education for an entry-level
Art [367]
I believe the correct answer from the choices listed above is option A. The <span> Information Technology career fields that generally requires the lowest level of education for an entry-level position would be </span><span>Information Services and Support. Hope this answers the question.</span>
5 0
3 years ago
Read 2 more answers
All states that have altered judicial selection techniques in recent years have adopted some form of:
BigorU [14]

Answer:

Merit Selection.

Answer choice D.

4 0
3 years ago
Read 2 more answers
Other questions:
  • When you ____ software, you are adapting it from one type of computer or operating system to run on a different computer or oper
    13·1 answer
  • ____ allow us to store a binary image in code. (1 point)
    9·1 answer
  • Microsoft Word is ________________ software.
    8·1 answer
  • How does kinetic energy affect the stopping distance of a vehicle traveling at 30 mph compared to the same vehicle traveling at
    6·1 answer
  • QUESTION 16
    14·1 answer
  • (25 POINTS) Some applications work on all devices while others work on some devices. True or False?
    13·1 answer
  • Your computer science teacher asks you to sample a black and white image that is 4” x 6”. How would you sample the image to prov
    10·1 answer
  • Can someone please give me Python test 3 it would help me tremendously
    5·1 answer
  • Research the significance of the UNIX core of macOS and write a few sentences describing your findings.
    8·1 answer
  • Need this java code its on zybooks. given two integers as user inputs that represent the number of drinks to buy and the number
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!