Here are The files that mentioned on the picture : //EarthObject.h - class declaration for the movement of an object on the earth /* This header file defines the structure of the `EarthObject` class. It declares the member variables needed to simulate an object's motion under Earth's gravity, such as gravitational acceleration constant, initial height, horizontal speed, and positional coordinates (x and y). Additionally, it declares constructors (default and parameterized) and member functions (setters and getters) necessary for the class's functionality. */ //TODO: Create a class called EarthObject And //EarthObject.cpp - function definitions for the movement of an object on the earth /* The implementation file for the `EarthObject` class. It defines the functionality of the constructors, setters, and getters declared in the header file. Setters include validation checks for input values, and getters calculate the x and y positions of the object over time based on the physics of motion under Earth's gravitational influence. */ #include "EarthObject.h" //TODO: Add your implementation here //MoonObject.h - class declaration for the movement of an object on the moon /* this header file defines the `MoonObject` class, tailored to simulate motion on the Moon. It includes additional properties, such as the initial vertical speed, to account for differences in lunar gravity. The file declares constructors, member variables, and member functions specific to lunar conditions. */ //TODO: Create a class called MoonObject And //MoonObject.cpp - function definitions for the movement of an object on the Moon. /* This is the implementation file for the `MoonObject` class. It provides the definitions for the class's constructors, setters (with validation), and getters. The functionalities are adjusted to reflect the Moon's lower gravitational acceleration and the possibility of an initial vertical speed. */ #include "MoonObject.h" //TODO: Add your implementation here And //ObjectMain.cpp - main program for moving objects on the moon and on earth #include #include "MoonObject.h" #include "EarthObject.h" using namespace std; int main(void) { double initialHeightEarth = 100; double horizontalSpeedEarth = 100; double initialHeightMoon = 100; double initialVerticalSpeedMoon = 10; double horizontalSpeedMoon = 100; MoonObject moon(initialHeightMoon, initialVerticalSpeedMoon, horizontalSpeedMoon); EarthObject earth(initialHeightEarth, horizontalSpeedEarth); double time; for (time = 0.0; moon.getYPos(time) > 0 && earth.getYPos(time) > 0; time += 0.001) {} cout << "time:" << time << endl; cout << "The moon object's horizontal position is " << moon.getXPos(time) << "m and vertical position is " << moon.getYPos(time) << "m" << endl; cout << "The earth object's horizontal position is " << earth.getXPos(time) << "m and vertical position is " << earth.getYPos(time) << "m" << endl << endl; bool valid; //TODO: Prompt the user to enter new parameters for the moon object and the earth object. // For the moon, the parameters are: initial height, initial vertical speed, // and the horizontal speed. // For the earth, the parameters are: initial height and the horizontal speed. //Be sure to perform validation on the entered values. //The simulation runs again for (time = 0.0; moon.getYPos(time) > 0 && earth.getYPos(time) > 0; time += 0.001) {} cout << endl; cout << "time:" << time << endl; cout << "The moon object's horizontal position is " << moon.getXPos(time) << "m and vertical position is " << moon.getYPos(time) << "m" << endl; cout << "The earth object's horizontal position is " << earth.getXPos(time) << "m and vertical position is " << earth.getYPos(time) << "m" << endl; return 0; }
Here are The files that mentioned on the picture : //EarthObject.h - class declaration for the movement of an object on the earth /* This header file defines the structure of the `EarthObject` class. It declares the member variables needed to simulate an object's motion under Earth's gravity, such as gravitational acceleration constant, initial height, horizontal speed, and positional coordinates (x and y). Additionally, it declares constructors (default and parameterized) and member functions (setters and getters) necessary for the class's functionality. */ //TODO: Create a class called EarthObject And //EarthObject.cpp - function definitions for the movement of an object on the earth /* The implementation file for the `EarthObject` class. It defines the functionality of the constructors, setters, and getters declared in the header file. Setters include validation checks for input values, and getters calculate the x and y positions of the object over time based on the physics of motion under Earth's gravitational influence. */ #include "EarthObject.h" //TODO: Add your implementation here //MoonObject.h - class declaration for the movement of an object on the moon /* this header file defines the `MoonObject` class, tailored to simulate motion on the Moon. It includes additional properties, such as the initial vertical speed, to account for differences in lunar gravity. The file declares constructors, member variables, and member functions specific to lunar conditions. */ //TODO: Create a class called MoonObject And //MoonObject.cpp - function definitions for the movement of an object on the Moon. /* This is the implementation file for the `MoonObject` class. It provides the definitions for the class's constructors, setters (with validation), and getters. The functionalities are adjusted to reflect the Moon's lower gravitational acceleration and the possibility of an initial vertical speed. */ #include "MoonObject.h" //TODO: Add your implementation here And //ObjectMain.cpp - main program for moving objects on the moon and on earth #include #include "MoonObject.h" #include "EarthObject.h" using namespace std; int main(void) { double initialHeightEarth = 100; double horizontalSpeedEarth = 100; double initialHeightMoon = 100; double initialVerticalSpeedMoon = 10; double horizontalSpeedMoon = 100; MoonObject moon(initialHeightMoon, initialVerticalSpeedMoon, horizontalSpeedMoon); EarthObject earth(initialHeightEarth, horizontalSpeedEarth); double time; for (time = 0.0; moon.getYPos(time) > 0 && earth.getYPos(time) > 0; time += 0.001) {} cout << "time:" << time << endl; cout << "The moon object's horizontal position is " << moon.getXPos(time) << "m and vertical position is " << moon.getYPos(time) << "m" << endl; cout << "The earth object's horizontal position is " << earth.getXPos(time) << "m and vertical position is " << earth.getYPos(time) << "m" << endl << endl; bool valid; //TODO: Prompt the user to enter new parameters for the moon object and the earth object. // For the moon, the parameters are: initial height, initial vertical speed, // and the horizontal speed. // For the earth, the parameters are: initial height and the horizontal speed. //Be sure to perform validation on the entered values. //The simulation runs again for (time = 0.0; moon.getYPos(time) > 0 && earth.getYPos(time) > 0; time += 0.001) {} cout << endl; cout << "time:" << time << endl; cout << "The moon object's horizontal position is " << moon.getXPos(time) << "m and vertical position is " << moon.getYPos(time) << "m" << endl; cout << "The earth object's horizontal position is " << earth.getXPos(time) << "m and vertical position is " << earth.getYPos(time) << "m" << endl; return 0; }
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Here are The files that mentioned on the picture :
//EarthObject.h - class declaration for the movement of an object on the earth
/*
This header file defines the structure of the `EarthObject` class.
It declares the member variables needed to simulate an object's motion
under Earth's gravity, such as gravitational acceleration constant,
initial height, horizontal speed, and positional coordinates (x and y).
Additionally, it declares constructors (default and parameterized)
and member functions (setters and getters) necessary for the class's functionality.
*/
//TODO: Create a class called EarthObject
And
//EarthObject.cpp - function definitions for the movement of an object on the earth
/*
The implementation file for the `EarthObject` class. It defines the
functionality of the constructors, setters, and getters declared in the header file.
Setters include validation checks for input values, and
getters calculate the x and y positions of the object over time
based on the physics of motion under Earth's gravitational influence.
*/
#include "EarthObject.h"
//TODO: Add your implementation here
//MoonObject.h - class declaration for the movement of an object on the moon
/*
this header file defines the `MoonObject` class,
tailored to simulate motion on the Moon.
It includes additional properties, such as the initial vertical speed,
to account for differences in lunar gravity. The file declares constructors,
member variables, and member functions specific to lunar conditions.
*/
//TODO: Create a class called MoonObject
And
//MoonObject.cpp - function definitions for the movement of an object on the Moon.
/*
This is the implementation file for the `MoonObject` class.
It provides the definitions for the class's constructors,
setters (with validation), and getters. The functionalities are adjusted
to reflect the Moon's lower gravitational acceleration and
the possibility of an initial vertical speed.
*/
#include "MoonObject.h"
//TODO: Add your implementation here
And
//ObjectMain.cpp - main program for moving objects on the moon and on earth
#include
#include "MoonObject.h"
#include "EarthObject.h"
using namespace std;
int main(void) {
double initialHeightEarth = 100;
double horizontalSpeedEarth = 100;
double initialHeightMoon = 100;
double initialVerticalSpeedMoon = 10;
double horizontalSpeedMoon = 100;
MoonObject moon(initialHeightMoon, initialVerticalSpeedMoon, horizontalSpeedMoon);
EarthObject earth(initialHeightEarth, horizontalSpeedEarth);
double time;
for (time = 0.0; moon.getYPos(time) > 0 && earth.getYPos(time) > 0; time += 0.001) {}
cout << "time:" << time << endl;
cout << "The moon object's horizontal position is " << moon.getXPos(time) << "m and vertical position is " << moon.getYPos(time) << "m" << endl;
cout << "The earth object's horizontal position is " << earth.getXPos(time) << "m and vertical position is " << earth.getYPos(time) << "m" << endl << endl;
bool valid;
//TODO: Prompt the user to enter new parameters for the moon object and the earth object.
// For the moon, the parameters are: initial height, initial vertical speed,
// and the horizontal speed.
// For the earth, the parameters are: initial height and the horizontal speed.
//Be sure to perform validation on the entered values.
//The simulation runs again
for (time = 0.0; moon.getYPos(time) > 0 && earth.getYPos(time) > 0; time += 0.001) {}
cout << endl;
cout << "time:" << time << endl;
cout << "The moon object's horizontal position is " << moon.getXPos(time) << "m and vertical position is " << moon.getYPos(time) << "m" << endl;
cout << "The earth object's horizontal position is " << earth.getXPos(time) << "m and vertical position is " << earth.getYPos(time) << "m" << endl;
return 0;
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 7 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education