Question: Need help writing a C + + program with Date.h , Date.cpp that is for a class Date with private members using int data type
Need help writing a C program with Date.h Date.cpp that is for a class Date with private members using int data type for month,day,and year. A default constructor is made to whatever date you prefer, and a overload constructor accepting parameters using month,day, year and please validate data for each months true set of days. Use appropriate accessor methods and appropriate mutator methods. Last create a print function to display mmddyy format please, keep this file we will use it for the next step.
Write a class called Student using the UML shown below:
Student
id : int
name : String
dateOfBirth : Date
height : double
Student
Studentint String,Date,double
StudentintString,int,int,int,double
setIdint id : void
setNameString n : void
setDoBDate d : void
setHeightdouble h : void
getId const : int
getName const : String
getDate const : Date
getHeight const : double
print const : void
Write the specification of the class Student in a file called student.h
Write the implementation of the class Student in a file called student.cpp
Constructor : set values to any value you like and there are three
constructors
Accessor Getter : to get value for id name and height. The date
field already has getters in the Date class and can be called when needed.
Mutator Setter : to set value of id name and height. Mutators for
the Date class can be called when needed.
print : method to data members of the Student class. The print
method of the Date class should be used to print birth date rather than
define again.
Demonstrate that your class is working by doing the following:
create three different Date objects d d d with values of your own
choosing.
create three different Student objects ss and s using dd and d
and values for the other data members of the Student class. Use values of
your own choosing.
Create an array called stuArray of type Student of size
Assign s s and s to the this stuArray array.
Use a loop to repeat three times to print each element of the array
stuArray by calling the print method of Student from this loop.
Now, create a different array called stuPtrArray of type Student
pointers of size
In a loop that will loop three times, dynamically create three different
objects of type student by asking user to enter each value and then create a
Student object dynamically and assign it to each element of the array.
Hence, the values for the student id name, date of birth and height should
be keyed from the keyboard. You may use any constructor that you feel
comfortable using.
In another loop, access each element of the stuPtrArray and call the
print method of Student to print information about each student.
Program should have Date.h Date.cpp Student.h Student.cpp and of course a main.cpp to run program. Highly apreciate the knowledg, thank you in advance for helping me understand coding better.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
