subject
Engineering, 14.05.2021 02:30 kaylazeiter

Task-1: In Cartesian coordinate system, a linear equation represents a line passing through two discrete points, such as, (1, 1) and (4, 2), respectively. Hence, one can easily describe the “point” object with a C++ class as given below.
class Point {
public:
Point(); //default constructor
Point(…); //parameterized constructor
Point(…); //copy constructor
~Point(); //destructor
… set_x(…); //some member functions
… set_y(…);
… get_x(…);
… get_y(…);
… print(); //prints the point object using some format, e. g., [1,2]
private:
int x, y; //data members
};
On the other hand, in order to create a “line” object, one can think of executing data composition technique where
the line object is composed of two discrete point objects. Hence, one can write the following:
class Line {
public:
Line(); //default constructor
Line(…); //parameterized constructor
Line(…); //copy constructor
~Line(); //destructor
… set_point1(…); //some member functions
… set_point2(…);
… get_slope(); //calculates the slope value
… print(); //prints the line object using some format
//e. g., A line passing through [2,2] and [4,4] with slope = 1.0
private:
Point p1, p2; //data composition!
};
a. Write definitions of the member functions listed above.
b. Rewrite the program by separating the implementation file from the interface using a header file.
 Provide a driver program to test each implementatio

ansver
Answers: 2

Another question on Engineering

question
Engineering, 03.07.2019 14:10
If the thermal strain developed in polyimide film during deposition is given as 0.0044. assume room temperature is kept at 17.3 c, and thermal coefficient of expansion for the film and the substrate are 54 x 10^-6c^-1 and 3.3 x 10^-6c^-1respectively. calculate the deposition temperature.
Answers: 3
question
Engineering, 04.07.2019 18:10
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
Answers: 3
question
Engineering, 04.07.2019 18:20
Air flows over a heated plate àt a velocity of 50m/s. the local skin factor coefficient at a point on a plate is 0.004. estimate the local heat transfer coefficient at this point.the following property data for air are given: density = 0.88kg/m3 , viscosity 2.286 x 10 ^-5 kgm/s , k = 0.035w/mk ,cp = 1.001kj/kgk. use colburn reynolds analogy.
Answers: 1
You know the right answer?
Task-1: In Cartesian coordinate system, a linear equation represents a line passing through two disc...
Questions
question
Mathematics, 01.02.2021 03:30
question
Health, 01.02.2021 03:30
question
Mathematics, 01.02.2021 03:30
question
Health, 01.02.2021 03:30
question
Mathematics, 01.02.2021 03:30
question
Mathematics, 01.02.2021 03:30
question
Mathematics, 01.02.2021 03:30
Questions on the website: 13722362