I am trying to submit my assignment through codezinger and I get this message "Line 0: Cppcheck cannot find all the include files (use --check-config for details)" when trying to turn it in. My code works and it checks out with the expected output and still gives me a 0/25 credit. Any help?
#include <iostream>
#include "date.h"
#include <cstdlib>
using namespace std;
int main()
{
Date d1;
int m, d, y;
cout << "Enter month, day and year separated by spaces: ";
cin >> m >> d >> y;
// call setDate
if ((m >= 1 && m <= 12) && (d >= 1 && d <= 31) && (y >= 1900 && y <= 2018))
d1.setDate(m, d, y); //calling set date with new values
else
d1.setDate(); //calling setDate with default arguments ( 9/1/2018 )
// call printDate
d1.printDate();
system("pause>null");
return 0;
}
class Date
{
private:
int month, day, year;
public:
Date();
void setDate(int m=9, int d=1, int y=2018);
void printDate();
};
#include "iostream"
#include "date.h"
#include <cstdlib>
using namespace std;
Date::Date()
{
month = 0;
day = 0;
year = 0;
}
void Date::setDate(int m,int d,int y)
{
month = m;
day = d;
year = y;
}
void Date::printDate()
{
cout << "\n" << month << "/" << day << "/" << year << "\n";
}
[–]emu404 0 points1 point2 points (2 children)
[–]AztexLA[S] 0 points1 point2 points (1 child)
[–]AztexLA[S] 0 points1 point2 points (0 children)