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
What was the purpose of the vasa ship
goldfiish [28.3K]
The main purpose was for power. The vessel has come to symbolize Sweden's Great Power Period, when the nation became a major European power and controlled much of the Baltic.
8 0
3 years ago
Technician a says that if a tapered roller bearing is adjusted to loose
Effectus [21]
The technician is true
5 0
3 years ago
A 12-ft circular steel rod with a diameter of 1.5-in is in tension due to a pulling force of 70-lb. Calculate the stress in the
padilas [110]

Answer:

The stress in the rod is 39.11 psi.

Explanation:

The stress due to a pulling force is obtained dividing the pulling force by the the area of the cross section of the rod. The respective area for a cylinder is:

A=\pi*D^2/4

Replacing the diameter the area results:

A= 17.76 in^2

Therefore the the stress results:

σ = 70/17.76 lb/in^2 = 39.11 lb/in^2= 39.11 psi

5 0
3 years ago
An electric field is expressed in rectangular coordinates by E = 6x2ax + 6y ay +4az V/m.Find:a) VMN if point M and N are specifi
Fittoniya [83]

Answer:

a.) -147V

b.) -120V

c.) 51V

Explanation:

a.) Equation for potential difference is the integral of the electrical field from a to b for the voltage V_ba = V(b)-V(a).

b.) The problem becomes easier to solve if you draw out the circuit. Since potential at Q is 0, then Q is at ground. So voltage across V_MQ is the same as potential at V_M.

c.) Same process as part b. Draw out the circuit and you'll see that the potential a point V_N is the same as the voltage across V_NP added with the 2V from the other box.

Honestly, these things take practice to get used to. It's really hard to explain this.

3 0
3 years ago
You find an unnamed fluid in the lab we will call Fluid A. Fluid A has a specific gravity of 1.65 and a dynamic viscosity of 210
Naily [24]

Answer:

1.2727 stokes

Explanation:

specific gravity of fluid A = 1.65

Dynamic viscosity = 210 centipoise

<u>Calculate the kinematic viscosity of Fluid A </u>

First step : determine the density of fluid A

Pa = Pw * Specific gravity =  1000 * 1.65 = 1650 kg/m^3

next : convert dynamic viscosity to kg/m-s

210 centipoise = 0.21 kg/m-s

Kinetic viscosity of Fluid A = dynamic viscosity / density of fluid A

                                            = 0.21 / 1650 = 1.2727 * 10^-4 m^2/sec

Convert to stokes = 1.2727 stokes

4 0
3 years ago
Other questions:
  • What does WCS stand for? A. Western CAD System B. Worldwide Coordinate Sectors C. World Coordinate System D. Wrong CAD Settings
    10·1 answer
  • Two mass streams of the same ideal gas are mixed in a steady-flow chamber while receiving energy by heat transfer from the surro
    11·1 answer
  • Blank Complete the following paragraph pertaining to the popular audio file formats.
    7·2 answers
  • How do I cancel my subscription
    12·2 answers
  • . Which of the following formula is used for calculating current:
    15·1 answer
  • A window‐mounted air‐conditioning unit (AC) removes energy by heat transfer from a room, and rejects energy by heat transfer to
    13·1 answer
  • 2=333=3= im single text in comment
    13·2 answers
  • True or false for the 4 questions?
    8·1 answer
  • Engineers please help im not good when it comes to drawing​
    8·1 answer
  • Which of these processes uses a die and a press to form parts?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!