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
A farmer has 12 hectares of land on which he grows corn, wheat, and soybeans. It costs $4500 per hectare to grow corn, $6000 to
maw [93]

The number of hectares of each crop he should plant are; 250 hectares of Corn, 500 hectares of Wheat and 450 hectares of soybeans

<h3>How to solve algebra word problem?</h3>

He grows corn, wheat and soya beans on the farm of 1200 hectares. Thus;

C + W + S = 12   ----(1)

It costs $45 per hectare to grow corn, $60 to grow wheat, and $50 to grow soybeans. Thus;

45C + 60W + 50S = 63750  -----(2)

He will grow twice as many hectares of wheat as corn. Thus;

W = 2C    ------(3)

Put 2C for W in eq 1 and eq 2 to get;

C + 2C + S = 1200

3C + S = 1200     -----(4)

45C + 60(2C) + 50S = 63750

45C + 120C + 50S = 63750

165C + 50S = 63750    ------(5)

Solving eq 4 and 5 simultaneosly gives;

C = 250 and W = 500

Thus; S = 1200 - 3(250)

S = 450

Read more about algebra word problems at; brainly.com/question/13818690

5 0
2 years ago
Jodie bought some shirts for 6$ each marge brought some shirts for 8$ each
Alex_Xolod [135]

Answer:

you need more details but if you have to find the difference, its $2.00

Explanation:

8-6=2

3 0
3 years ago
A PLL is set up so that its VCO free-runs at 8.9 MHz. The VCO does not change frequency unless its input is within plus or minus
pickupchik [31]
It’s A 75khz because it’s plus or minus so if u add it would be too much
5 0
3 years ago
Plz solve the problem
julsineya [31]
I attached a photo that explains and gives the answer to your questions. Had to add a border because the whole picture didn’t fit.

6 0
3 years ago
Q2) An engineer borrowed $3000 from the bank, payable in six equal end-of-year payments at 8%. The bank agreed to reduce the int
tatyana61 [14]
Answer is: $637.28; just did the math but i really don’t want to type it all out.
6 0
3 years ago
Other questions:
  • Determine the minimum force P to prevent the 30 kg uniform rod AB from sliding. The contact surface at B is smooth, whereas the
    13·1 answer
  • Explain the four criteria for proving the correctness of a logical pretest loop construct of the form "while B do S end". And pr
    12·1 answer
  • Which type of irrigation conserves more water than other types of irrigation?
    8·1 answer
  • Under the normal sign convention, the distributed load on a beam is equal to the:_______A. The rate of change of the bending mom
    13·1 answer
  • In a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their
    8·1 answer
  • Parallel circuits???
    9·1 answer
  • The toughness of a material does what, when it's been heated?​
    7·1 answer
  • Fixed rate mortgage offer:
    9·2 answers
  • Please help me. I have no idea what I'm doing.​
    14·2 answers
  • Travel Planning or Destination Planning will help make your travel more efficient, and not necessary a risk reduction plan as yo
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!