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
Heats of Reaction and Hess's Law experiment tells you to look up three values. Write down these values. Be sure to clearly indic
Anna [14]

Answer:

Enthalpy of reaction (kJoules/mole)

Heat of formation of products (kJoules/mole)

Heat of reaction of reactants (kJoules/mole)

Explanation:

The general expression for calculating the overall enthalpy of reaction is given as following:

ΔH = ∑ΔH[producst] - ∑Δ[reactants]

Thus, the heat of reaction is given as the difference between the formation of the products and the formation of the reactants. The units are expressed as kJ/mol of reactants or products.

Thus, the three values are fundamental in the determination of the overall energy of the reaction from Hess' Law.

8 0
3 years ago
I have a 308 bullet stuck in my ak,s mag help?
Assoli18 [71]
Lick the bullet and push it down
3 0
3 years ago
Read 2 more answers
A disk‑shaped part is to be cast out of aluminum. The diameter of the disk = 401 mm and its thickness = 25 mm. If the mold const
kupik [55]

Answer:    

  w

Explanation:

3 0
4 years ago
Jelena is 26 and has worked in the service industry for most of her work history. She is willing to advance her education and tr
katrin2010 [14]
Customer service

Since she has reckless driving and her record, anything involving driving of some sorts mechanics as well won’t work well with her!! Hope this helps
8 0
3 years ago
Circular fins are employed around the cylinder of a lawn mower engine to dissipate heat. The fins are made of aluminum are 0.3-m
frosja888 [35]

Answer: heat through each fin is 291W

Total no of required fin from design calculations is 3

Explanation:

The detailed calculations and explanation is shown in the image below.

8 0
3 years ago
Other questions:
  • Which of the following factors does not promote safety in the shop?
    15·1 answer
  • What are the seven problem solving steps?
    12·1 answer
  • A 11-cm-diameter horizontal jet of water with a velocity of 40 m/s relative to the ground strikes a flat plate that is moving in
    7·1 answer
  • Assume (for simplicity in this exercise) that only one tuple fits in a block and memory holds at most three blocks. Show the run
    8·1 answer
  • Who is the best musician in Nigeria<br>​
    11·2 answers
  • Why doesn’t the servant kill the child oedipus as he was ordered to do
    11·1 answer
  • Do all websites use the same coding to create?
    8·1 answer
  • 2.44mW of incident 520 nm light is directed through a1 cm sample cuvette and 0.68 mW of Plight exits the sample what is the abso
    9·1 answer
  • You have a motor such that if you give it 12 Volt, it will eventually reach a steady state speed of 200 rad/s. If it starts from
    10·1 answer
  • Kyla has obtained a bachelor’s degree in electronics engineering. In her search for a job, she comes across an advertisement tha
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!