Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ 1) Implement a class named CTime Machine; Class CTime Machine has the class named CPresent and the class named CFuture; (2 points) 2)

image text in transcribed

In c++

1) Implement a class named CTime Machine; Class CTime Machine has the class named CPresent and the class named CFuture; (2 points) 2) The object class Ctime Machine time TravelOBJ created the object *futureOBJ as a tool that is used to change the object *presentOBJ; Therefore, having the object * futureOBJ within your time TravelOBJ, pass the object *presentOBJ as a pointer for the object *futureOBJ;(2 points) 3) The futureOBJ has a huge impact in the present as the struct data_fifth_dimension time is comprised of: int remaining_life_span (either ask user or read from file what is the lifespan), int alive, int year_in_the_future; *futureOBJ is an array to use dynamic memory allocation according to the number of lifes to be controlled; e.g. if total_lifes = 5 then *futureOBJ[total_lifes] that is allocated with the command new; each decision taken in the *futureOBJ changes the status of *presentOBJ. The *presentOBJ contains the struct data_fifth_dimension present_time. (2 points) 4) From the *futureOBJ create the method decide_the_future, to ask the user what decision is taken from Darth Vader about what is the value for the year_in_the_future, and then if the person should continue alive or die and in which year to die, which is the past of the future: int alive - giving 1 to live or 0 to die. (2 points) 5) From the *futureOBJ Darth Vader is able to take the decision to change or not the present, manipulating the future; time belongs to the *futureOBJ, but influences the *presentOBJ, as the *futureOBJ receives *presentOBJ pointer memory address from that object, as *presentOBJ contains the present_time. So, create the method biologicalClock in *presentOBJ; run a loop inside the method biologicalClock that will for each iteration represent one year of the person's life, moving forward if the person is alive according to his remaining_life_span; which is subtracted by one for each loop iteration, printing the message: "alive/person_id_number/ count_down_still_living; otherwise print Darth Vader decide_to_kill / person_name / count_down_would_be_still_alive"; stop running the time travel simulator loop when your iteration loop become the same value as you got back to the future: int year_in_the_future; (2 points) 1) Implement a class named CTime Machine; Class CTime Machine has the class named CPresent and the class named CFuture; (2 points) 2) The object class Ctime Machine time TravelOBJ created the object *futureOBJ as a tool that is used to change the object *presentOBJ; Therefore, having the object * futureOBJ within your time TravelOBJ, pass the object *presentOBJ as a pointer for the object *futureOBJ;(2 points) 3) The futureOBJ has a huge impact in the present as the struct data_fifth_dimension time is comprised of: int remaining_life_span (either ask user or read from file what is the lifespan), int alive, int year_in_the_future; *futureOBJ is an array to use dynamic memory allocation according to the number of lifes to be controlled; e.g. if total_lifes = 5 then *futureOBJ[total_lifes] that is allocated with the command new; each decision taken in the *futureOBJ changes the status of *presentOBJ. The *presentOBJ contains the struct data_fifth_dimension present_time. (2 points) 4) From the *futureOBJ create the method decide_the_future, to ask the user what decision is taken from Darth Vader about what is the value for the year_in_the_future, and then if the person should continue alive or die and in which year to die, which is the past of the future: int alive - giving 1 to live or 0 to die. (2 points) 5) From the *futureOBJ Darth Vader is able to take the decision to change or not the present, manipulating the future; time belongs to the *futureOBJ, but influences the *presentOBJ, as the *futureOBJ receives *presentOBJ pointer memory address from that object, as *presentOBJ contains the present_time. So, create the method biologicalClock in *presentOBJ; run a loop inside the method biologicalClock that will for each iteration represent one year of the person's life, moving forward if the person is alive according to his remaining_life_span; which is subtracted by one for each loop iteration, printing the message: "alive/person_id_number/ count_down_still_living; otherwise print Darth Vader decide_to_kill / person_name / count_down_would_be_still_alive"; stop running the time travel simulator loop when your iteration loop become the same value as you got back to the future: int year_in_the_future; (2 points)

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago