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
Jade wanted to test the effect of ice on the weathering of rocks. She filled two containers with gypsum and placed a water ballo
Aleks [24]

Answer:

 

The gypsum block with the water balloon has contracted.

Explanation:

7 0
2 years ago
g A food department is kept at -12oC by a refrigerator in an environment at 30oC. The total heat gain to the food department is
boyakko [2]

Answer:

a) \dot W = 0.417\,kW, b) COP_{R} = 2.198, c) Irreversible.

Explanation:

a) The power input required by the refrigerator is:

\dot W = \dot Q_{H} - \dot Q_{L}

\dot W = \left(4800\,\frac{kJ}{h} - 3300\,\frac{kJ}{h}\right)\cdot \left(\frac{1}{3600} \,\frac{h}{s} \right)

\dot W = 0.417\,kW

b) The Coefficient of Performance of the refrigerator is:

COP_{R} = \frac{\dot Q_{L}}{\dot W}

COP_{R} = \frac{3300\,\frac{kJ}{h} }{(0.417\,kW)\cdot \left(3600\,\frac{s}{h} \right)}

COP_{R} = 2.198

c) The maximum ideal Coefficient of Performance of the refrigeration is given by the inverse Carnot's Cycle:

COP_{R,ideal} = \frac{T_{L}}{T_{H}-T_{L}}

COP_{R,ideal} = \frac{261.15\,K}{303.15\,K - 261.15\,K}

COP_{R,ideal} = 6.218

The refrigeration cycle is irreversible, as COP_{R} < COP_{R,ideal}.

3 0
3 years ago
Subject : SCIENCE
Leviafan [203]

Answer:

Increase the eletric current

slow down the resistance

Explanation:

7 0
2 years ago
A program contains the following function definition: int cube(int number) { return number * number * number; } Write a stateme
Nonamiya [84]

Answer:

The statement can be written as

int result = cube(4);

Explanation:

A function is a block of reusable codes to perform some tasks. For example, the function in the question is to calculate the cube of a number.

A function can also operate on one or more input value (argument) and return a result. The <em>cube </em>function in the question accept one input value through its parameter <em>number </em>and the <em>number</em> will be multiplied by itself twice and return the result.  

To call a function, just simply write the function name followed with parenthesis (e.g. <em>cube()</em>). Within the parenthesis, we can include zero or one or more than one values as argument(s) (e.g. <em>cube(4)</em>).

We can then use the "=" operator to assign the return output of the function to a variable (e.g. <em>int result = cube(4)</em>)

8 0
3 years ago
A __________ is an added note showing additional or more specific information.
xxMikexx [17]

Answer:

awnsers should be added to know to show additional

8 0
3 years ago
Other questions:
  • A petrol engine produces 20 hp using 35 kW of heat transfer from burning fuel. What is its thermal efficiency, and how much powe
    14·1 answer
  • Compare automation and autonomous
    12·1 answer
  • - if `check_1` and `check_2` variables are both True, it should set the value of a variable `outcome` to the string 'BOTH' - eli
    12·1 answer
  • Steam at 150 bars and 600°C passes through process equipment and emerges at 100 bars and 700°C. There is no flow of work into or
    8·1 answer
  • A photovoltaic panel of dimension 2m×4m is installed on the
    14·1 answer
  • Two pressure gauges measure a pressure drop of 16.3 psi (lb/in.2) at the entrance and exit of an old buried pipeline. The origin
    13·1 answer
  • The purpose of the __________ algorithm is to enable two users to exchange a secret key securely that can then be used for subse
    8·1 answer
  • Diffrerentiate y=cos^{4} (3x+1)
    5·1 answer
  • Should i show my face?
    8·2 answers
  • Stress that acts in the plane of a cut section, rather than at right angles to the section is called:_______
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!