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
The solid cylinders AB and BC are bonded together at B and are attached to fixed supports at A and C. The modulus of rigidity is
romanna [79]

Answer:

a) 0.697*10³ lb.in

b) 6.352 ksi

Explanation:

a)

For cylinder AB:

Let Length of AB = 12 in

c=\frac{1}{2}d=\frac{1}{2} *1.1=0.55in\\ J=\frac{\pi c^4}{2}=\frac{\pi}{2}0.55^4=0.1437\ in^4\\

\phi_B=\frac{T_{AB}L}{GJ}=\frac{T_{AB}*12}{3.3*10^6*0.1437}  =2.53*10^{-5}T_{AB}

For cylinder BC:

Let Length of BC = 18 in

c=\frac{1}{2}d=\frac{1}{2} *2.2=1.1in\\ J=\frac{\pi c^4}{2}=\frac{\pi}{2}1.1^4=2.2998\ in^4\\

\phi_B=\frac{T_{BC}L}{GJ}=\frac{T_{BC}*18}{5.9*10^6*2.2998}  =1.3266*10^{-6}T_{BC}

2.53*10^{-5}T_{AB}=1.3266*10^{-6}T_{BC}\\T_{BC}=19.0717T_{AB}

T_{AB}+T_{BC}-T=0\\T_{AB}+T_{BC}=T\\T_{AB}+T_{BC}=14*10^3\ lb.in\\but\ T_{BC}=19.0717T_{AB}\\T_{AB}+19.0717T_{AB}=14*10^3\\20.0717T_{AB}=14*10^3\\T_{AB}=0.697*10^3\ lb.in\\T_{BC}=13.302*10^3\ lb.in

b) Maximum shear stress in BC

\tau_{BC}=\frac{T_{BC}}{J}c=13.302*10^3*1.1/2.2998=6.352\ ksi

Maximum shear stress in AB

\tau_{AB}=\frac{T_{AB}}{J}c=0.697*10^3*0.55/0.1437=2.667\ ksi

8 0
3 years ago
Explain the four criteria for proving the correctness of a logical pretest loop construct of the form "while B do S end". And pr
evablogger [386]

Answer:

Check the explanation

Explanation:

The loop invariant has to satisfy some amount of requirements to be of good use. Another complex factor as to why a loop is the question of loop termination. A loop that doesn’t terminate can’t invariably be correct, and in fact the computation in whatever form amounts to nothing. The total axiomatic description of a while construct will have to involve all of the following to be true, in which I is the loop invariant:

P => I

{I and B} S {I}

(I and (not B)) => Q

Then the loop terminates

6 0
2 years ago
What are the dimensions of the base of the pyramid?
Cloud [144]

Answer:

b

Explanation:

bcus it is

7 0
2 years ago
You are designing the access control policies for a Web-based retail store. Customers access the store via the Web, browse produ
PolarNik [594]

Answer:

Object-Oriented Software Engineering Using UML, Patterns, and Java, 3e, shows readers how to use both the principles of software engineering and the practices of various object-oriented tools, processes, and products.

3 0
2 years ago
How can I solve 23.5 million Nona meters to millimeters using no calculator because I have to show my work
katrin2010 [14]

Express it in standard form and apply the basic indices laws to simplify

6 0
2 years ago
Read 2 more answers
Other questions:
  • Which conditions are required for nuclear fusion to begin
    8·1 answer
  • The air contained in a room loses heat to the surroundings at a rate of 60 kJ/min while work is supplied to the room by computer
    7·2 answers
  • What is the relative % change in P if we double the absolute temperature of an ideal gas keeping mass and volume constant?
    14·1 answer
  • If a machine uses LESS effort to overcome a given resistance force (if Fe is less than FR), it has an actual mechanical advantag
    13·1 answer
  • A compound machine contains three simple machines with IMAs of 2, 4 and 5, respectively. What is the overall ideal mechanical ad
    15·1 answer
  • How do the remains of plants and animals become fossil fuels. Why are they considered nonrenewable resources?
    13·1 answer
  • • Differentiate between laboratory and industrial reactors​
    11·1 answer
  • If you have 300 skittles in a bag and you need to have 28 percent yellow. How many yellow skittles would you have to make a mini
    11·1 answer
  • PLS :(((( HELP HELPPPP
    13·1 answer
  • Who has the authority to declare a "global emergency"?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!