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
Question Completion Status:
Mashutka [201]

Answer: c. Centre of pressure​

Explanation:

Pressure is applied on a surface when a force is exerted on a particular point on that surface by another object when the two come into contact with each other.

The point where the pressure is applied is known as the centre of the pressure with the force then spreading out from this point much like an epicentre in an earthquake.

6 0
3 years ago
Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop the program exa
ELEN [110]

Answer:

%Program prompts user to input vector

v = input('Enter the input vector: ');

%Program shows the value that user entered

fprintf('The input vector:\n ')

disp(v)

%Loop for checking all array elements

for i = 1 : length(v)

   %check if the element is a positive number

   if v(i) > 0

       %double the element

       v(i) = v(i) * 2;

   %else the element is negative number.

   else

       %triple the element

       v(i) = v(i) * 3;

   end

end

%display the modified vector

fprintf('The modified vector:\n ')

disp(v)

4 0
3 years ago
What is the first test you should do when checking the charging system?
yan [13]

Answer:

Connect the test light in series with the negative post, and start pulling feed wires. The first to check is the heavy charging wire from the alternator. A bad or leaky diode in an alternator is a very common source of overnight battery drain. Connect wires one at a time to see what lead is drawing current.

8 0
2 years ago
What is Pressure measured from absolute zero pressure called?
7nadin3 [17]
Anything greater than total vacuum is technically a form of pressure
5 0
3 years ago
ILL GIVE BRAINLIEST!!!
Sedbober [7]
Get the app socratic I saw the answer to your question on the app but I ran out of screen time to show you
6 0
2 years ago
Other questions:
  • Choose the best data type for each of the following so that any reasonable value is accommodated but no memory storage is wasted
    5·1 answer
  • Which should i get they are both for sale
    10·2 answers
  • A three-point bending test is performed on a glass specimen having a rectangular cross section of height 5.3 mm and width 11.6 m
    11·1 answer
  • What is wrong with the following code?<br> 6<br> print (what is your name?)
    9·2 answers
  • Consider coaxial, parallel, black disks separated a distance of 0.20 m. The lower disk of diameter 0.40 m is maintained at 500 K
    13·1 answer
  • The distribution of SAT scores of all college-bound seniors taking the SAT in 2014 was approximately normal with mean μ=1497 and
    12·1 answer
  • What is government role in the modern American version of capitalism
    11·1 answer
  • 2=333=3= im single text in comment
    13·2 answers
  • Orbit is to _____ as altitude is to _____.
    13·2 answers
  • Identify three questions a patient might ask of the nuclear medicine technologist performing a nuclear medicine exam.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!