c++ needs some feed back :)

An object of class LabMetaData has the following attributes:

Lab Number - A whole, positive number. Zero is valid.
Lab Title - A title for the Lab Assignment
Lab Author - The name of the programmer that wrote the lab.
Lab Date - The date the lab was written, stored as three integer numbers. The Day must be between 1 and 31. The month must be between 1 and 12. The year must be 4 digits and in the 21st Century (between 2000 and 2099).
Lab Description - A description of the Lab Assignment.

An object of class LabMetaData has the following methods:
. Constructor - set the Lab Number to zero, the Lab date to 1/1/2010,
and all other attributes to empty strings. (Hint: call the SetData()
from the constructor function to avoid duplicating your code)
. SetData() - sets the attributes of the object to the parameters as long
as the parameters are valid. Rules:
o ALL of the parameters must be valid in order for ANY of the
attributes to change.
o Validation rules are explained above for Lab Number and Lab Date.
Title, Author, and Description have no validation.
o If no problems are detected, return TRUE. Otherwise return FALSE.
. ShowData() - displays all the object's attributes on the console.


so far i got:

#include <iostream>
using namespace std;


int main()
{

LabMetaData Lab4;

cout << endl << "Uninitialized: " << endl;
Lab4.ShowData();

Lab4.SetData(4, "Lab Meta Data", "YOUR NAME", 10, 3, 2010, "Introducing basic classes.");

cout << endl << "Intialized: " << endl;
Lab4.ShowData();

if(!Lab4.SetData(-1, "Test", "Test", 13, 32, 11, "Causing Errors"))
cout << "\nErrors!" << endl;

cout << endl << "After Invalid Modification Attempt: " << endl;
Lab4.ShowData();

cout << endl << endl;
system("pause");
return 0;
}
Last edited on
What kind of feedback are you looking for? Everything looks fine to me.
well for my lab it asked me to "In this lab you will create a new class called LabMetaData. Objects of this class could be used in future lab assignments to store information about the lab itself. " so im just kinda stuck
Topic archived. No new replies allowed.