Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the ctime header file contains a special function called time(0) which returns the number of seconds since 1/1/1970 when the function is called. you will

the ctime header file contains a special function called time(0) which returns the number of seconds since 1/1/1970 when the function is called.

you will test this function as following:

create a class called TimeC, this class contains:

- a private integer call it creation

- default constructor, assign time(0) to creation

- a method that will return creation value, call it getCreationTime() (the method should return an integer)

- a method to calculate the age (call it age and it returns an integer). in this method, a new value for time(0) will be calculated. the previous creation value should be subtracted from it. [time(0)-creation]

test your class as following:

- creating an TimeC object

- print the creation value by calling the method getCreationTime()

- print a waiting message on the screen to hold the execution for few seconds.

* use system("pause"); or cin.get(x);

[for cin.get(x) you will need to create a char variable called x]

- print the age value by calling the function age();

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago