Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The class Point stores the location of the origin as static values ORIGIN_X and ORIGIN_Y. It provides public functions to access those values. Add code

The class Point stores the location of the origin as static values ORIGIN_X and ORIGIN_Y. It provides public functions to access those values. Add code to main to call the static functions to print out the X and Y location of the Origin with a space between them. Do NOT try to make any point objects - call the functions directly on the class. Yes, I know you can cheat on this one by just printing "0 0"... figure out how to do it for real We are defining all the code inside the class declaration. This only works for simple one file projects like this one. Do not do this in assignments.

#include

using namespace std;

class Point { public: static double getOriginXValue() { return ORIGIN_X; } static double getOriginYValue() { return ORIGIN_Y; }

private: Point() {} //private so you can't use it double x; double y;

static const double ORIGIN_X; static const double ORIGIN_Y; };

const double Point::ORIGIN_X = 0; const double Point::ORIGIN_Y = 0;

int main() {

//Do not modify anything on or above the line below this //YOUR_CODE_BELOW //YOUR_CODE_ABOVE //Do not modify anything on or below the line above this

return 0; }

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxxviii Special Issue On Database And Expert Systems Applications Lncs 11250

Authors: Abdelkader Hameurlain ,Roland Wagner ,Sven Hartmann ,Hui Ma

1st Edition

3662583836, 978-3662583838

More Books

Students also viewed these Databases questions