Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) write code to do the following - declare a variable ptr as a ponter to int an

ID: 3559641 • Letter: 1

Question

1) write code to do the following

- declare a variable ptr as a ponter to int and initialize it to NULL

- dynamically allocate memory for an array of 100 elements

- read 100 elements from the standard input device and store them in the array.

2) Assume a class Time and its derived class extendedTime have been defined as described in the previous problems and implemented. Also assume the following function displayTime:

void displayTime (Time someTime){

cout << "Time is:";

someTime.write();

}

What is the output by the following test program? (assume all header files are included properly)

I need a clear explanation about how to get the output of the program

int main(){

Time t1(8,30);

extendedTime t2(10,44,"CST");

displayTime(t1);

displayTime(t2);

return 0;

}

Explanation / Answer

2

Time is: 8:30

Time is: 10:44 CST

if not

Time is: 8:30

Time is: 10:44