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
dolphi86 [110]
3 years ago
8

Writing a modular program in visual c++. I am new to this and not sure what I am missing. I am getting the following error:

Computers and Technology
1 answer:
stich3 [128]3 years ago
7 0

Answer:

#include <iostream>

bool validateDate(int, int, int);

using namespace std;

int main()

{

int year;

int month;

int day;

const int MIN_YEAR = 0, MIN_MONTH = 1, MAX_MONTH = 12, MIN_DAY = 1, MAX_DAY = 31;

bool validDate = true;

   cout<<"Enter the year"<<endl;

   cin>>year;

   cout<<"Enter the month"<<endl;

   cin>>month;

   cout<<"Enter the day"<<endl;

   cin>>day;

if(year <= MIN_YEAR) // invalid year

    validDate = false;

else if (month < MIN_MONTH || month > MAX_MONTH) // invalid month

    validDate = false;

else if (day < MIN_DAY || day > MAX_DAY) // invalid day

    validDate = false;

if(validDate == true)

{

    // Output statement

    cout<<month<<"/"<<day<<"/"<<year<<"is a valid date"<<endl;

}

else

{

    // Output statement

    cout<<month<<"/"<<day<<"/"<<year<<" is an invalid date"<<endl;

}

}

Explanation:

  • Declare variables and take the date as input from user .
  • Inside the main function, check if year is valid using the conditional statements.
  • Check if date is valid and then output that accordingly.
You might be interested in
An important piece of a project is past due date.
bixtya [17]
Budget and time is the answer
4 0
3 years ago
Read 2 more answers
Njdnkjsdnjvnsdjvnjsdnvjsdvnjdnvjdsnvnksn
adoni [48]

Answer:

yes

Explanation:

7 0
3 years ago
Rachel typed two paragraphs and then realized she was in the wrong document. What steps should Rachel follow to quickly move the
igomit [66]
It would be A. I hope that this helps!
6 0
3 years ago
Read 2 more answers
How do you change a LAN (local area network) to a WAN (wide-area network)
ahrayia [7]

Answer:

Go to internet, click use as LAN under the cable section and click yes to confirm

4 0
3 years ago
Any Genshin Impact Players? If so, who's your main?
Fantom [35]
I want to start playing!! it seems super cool, don’t know much ab it but i like paimon lol
5 0
3 years ago
Read 2 more answers
Other questions:
  • Tornado Alley is located in the middle of the United States, extending from Texas up through the Dakotas. The above statement is
    14·1 answer
  • What is tuple and attribute of a relation​
    11·1 answer
  • Enlist the various data analysis methods for study of Infrasonic waves, Seismic waves, Earthquake prone areas and how AI can be
    15·1 answer
  • In cell B20, enter a function to calculate the average attendance for 2018
    11·1 answer
  • What is a characteristic of maintaining logs in a system? A. Logging prevents security violations, but only deals with passive m
    10·1 answer
  • Why Use LinkedIn AI Automation Tools to Grow Your Sales Pipeline?
    7·1 answer
  • Describe psychographic differences among the past five generations of Americans that you learned about in this course. What type
    6·1 answer
  • Can someone reply me
    11·1 answer
  • Using a wireless technology known as ___, many smartphones can now be tapped on special payment devices to complete your purchas
    13·1 answer
  • Which discipline focuses on the design of computer hardware?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!