1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vladimir1956 [14]
3 years ago
13

A point in the x-y plane is represented by its x-coordinate and y-coordinate. Design the class Point that can store and process

a point in the x-y plane. You should then perform operations on a point, such as showing the point, setting the coordinates of the point, printing the coordinates of the point, returning the x-coordinate, and returning the y-coordinate. Also, write a test program to test various operations on a point.
Engineering
1 answer:
Black_prince [1.1K]3 years ago
5 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

class pointType

{

public:

pointType()

{

x=0;

y=0;

}

pointType::pointType(double x,double y)

{

this->x = x;

this->y = y;

}          

void pointType::setPoint(double x,double y)

{

this->x=x;

this->y=y;

}

void pointType::print()

{

cout<<"("<<x<<","<<y<<")\n";

}

double pointType::getX()

{return x;

}

double pointType::getY()

{return y;

}

private:

   double x,y;

};

int main()

{

pointType p2;

double x,y;

cout<<"Enter an x Coordinate for point ";

cin>>x;

cout<<"Enter an y Coordinate for point ";

cin>>y;

p2.setPoint(x,y);

p2.print();

system("pause");    

return 0;

}

You might be interested in
How could increasing the budget for testing have prevented the problem experienced by the mars orbiter?
vlada-n [284]

Answer:

this might help

Explanation:

https://science.ksc.nasa.gov/mars/msp98/misc/MCO_MIB_Report.pdf

5 0
3 years ago
Alberto's mom is taking a splinter out of his hand with a pair of tweezers. The tweezers are 3 inches long. She is applying .25
Burka [1]

Answer:

ok

Explanation:

here you go

5 0
4 years ago
Read 2 more answers
There are three different types of slings. What determines which type you use?
IgorLugansk [536]

Answer:

I think answer is The type of load, Environment factors

7 0
3 years ago
⦁ An ideal Otto cycle has a compression ratio of 8. At the beginning of the compression process, air is at 95 kPa and 27°C, and
Anon25 [30]

Answer:

<u><em>note:</em></u>

<u><em>solution is attached in word form due to error in mathematical equation. furthermore i also attach Screenshot of solution in word due to different version of MS Office please find the attachment</em></u>

Download docx
8 0
4 years ago
The velocity of a fluid flowing between 2 parallel plates is given as a function of the distance between the plates (y) by the e
daser333 [38]

Peppa pig Peppa pig peppa pig peppa pig

4 0
3 years ago
Other questions:
  • The volume at a section of a 2-lane highway is 1800 vph in each direction and the density is approximately 30 bpm. A slow moving
    10·1 answer
  • Continuing education and seeking opportunities for relaxation are two types of professional development.
    14·2 answers
  • What is the perimeter of 14-7 and 3-4
    9·1 answer
  • In a company, a new process is put in place that uses flash cards to make manufacturing more effective. What type of waste is th
    7·1 answer
  • A coil of wire 8.6 cm in diameter has 15 turns and carries a current of 2.7 A. The coil is placed in a magnetic field of 0.56 T.
    5·1 answer
  • A simple supported beam at x0 = 0 and xn = L with a uniform load w and the
    15·2 answers
  • How does an electric circuit work?<br><br> Please give a detailed answer- thx
    8·2 answers
  • Who wants me to make a device to resurrect Juice Wrld
    7·1 answer
  • I really need help with my last topic,Hazard communication,if anyone can help me as soon as possible,that could be my Christmas
    12·1 answer
  • 6.48 programming project 1: encode/decode tic -tac-toe
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!