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
lidiya [134]
1 year ago
12

Write a class having two private variables and one-member function which will return the area of the rectangle.

Engineering
1 answer:
Yuri [45]1 year ago
5 0

Using the knowledge in computational language in C++ it is possible to write the code being write a class having two private variables

<h3>Writting the code in C++:</h3>

<em>#include <iostream></em>

<em>using namespace std;</em>

<em />

<em>class Rectangle { /*create a class named Rectangle*/</em>

<em />

<em>   private:</em>

<em>   float l,b; /*this class has two private variables l and b*/</em>

<em>   public:</em>

<em>   float getArea(float l, float b) /*this class has one member-function getArea which returns the area of the rectangle*/</em>

<em>   {</em>

<em>    return l*b; /*return the area of the rectangle*/</em>

<em>   }</em>

<em />

<em>};</em>

<em />

<em />

<em>int main () { /*the main function to check the working of our Rectangle class*/</em>

<em />

<em>  float l,b;</em>

<em>  Rectangle r1; /*create an object r1 of Rectangle class*/</em>

<em>  cout<<"Enter the length of the rectangle: ";</em>

<em>  cin>>l; /*input the length of the rectangle from the user*/</em>

<em>  cout<<"Enter the breadth of the rectangle: ";</em>

<em>  cin>>b; /*input the breadth of the rectangle from the user*/</em>

<em>  cout <<"Area of the rectangle is: "<< r1.getArea(l,b)<<" square units."; /*find the area of the rectangle using the member function of the class*/</em>

<em>  return 0;</em>

<em>}</em>

See more about C++ at brainly.com/question/19705654

#SPJ1

You might be interested in
Click this link to view O*NET’s Wages and Employment section for Film and Video Editors.
vova2212 [387]

Answer:

much faster than average

Explanation:

did it on edge (2022-2032)

6 0
2 years ago
Two balls are chosen randomly from an urn containing 8 white 4 black, and orange balls. Suppose that we win $ 2 for each black b
Scorpion4ik [409]
(-2,-10,-1,-2,-3,-4)
8 0
3 years ago
Can the MOXIE created by NASA be used on earth
Alisiya [41]

Answer:

MOXIE is designed to generate up to 10 grams of oxygen per hour. This technology demonstration was designed to ensure the instrument survived the launch from Earth, a nearly seven-month journey through deep space, and touchdown with Perseverance on Feb

4 0
3 years ago
In an experiment, the local heat transfer over a flat plate were correlated in the form of local Nusselt number as expressed by
zvonat [6]

Answer:

R= 1.25

Explanation:

As given the local heat transfer,

Nu_x = 0.035 Re^{0.8}_x Pr^{1/3}

But we know as well that,

Nu=\frac{hx}{k}\\h=\frac{Nuk}{x}

Replacing the values

h_x=Nu_x \frac{k}{x}\\h_x= 0.035Re^{0.8}_xPr^{1/3} \frac{k}{x}

Reynolds number is define as,

Re_x = \frac{Vx}{\upsilon}

Where V is the velocity of the fluid and \upsilon is the Kinematic viscosity

Then replacing we have

h_x=0.035(\frac{Vx}{\upsilon})^{0.8}Pr^{1/3}kx^{-1}

h_x=0.035(\frac{V}{\upsilon})^{0.8}Pr^{1/3}kx^{0.8-1}

h_x=Ax^{-0.2}

<em>*Note that A is just a 'summary' of all of that constat there.</em>

<em>That is A=0.035(\frac{V}{\upsilon})^{0.8}Pr^{1/3}k</em>

Therefore at x=L the local convection heat transfer coefficient is

h_{x=L}=AL^{-0.2}

Definen that we need to find the average convection heat transfer coefficient in the entire plate lenght, so

h=\frac{1}{L}\int\limit^L_0 h_x dx\\h=\frac{1}{L}\int\limit^L_0 AL^{-0.2}dx\\h=\frac{A}{0.8L}L^{0.8}\\h=1.25AL^{-0.2}

The ratio of the average heat transfer coefficient over the entire plate  to the local convection heat transfer coefficient is

R = \frac{h}{h_L}\\R= \frac{1.25Al^{-0.2}}{AL^{-0.2}}\\R= 1.25

3 0
3 years ago
Using a pressure transducer and lab scope is a similar process to using a pressure gauge- true/false
MariettaO [177]

Answer:

true

Explanation:

4 0
3 years ago
Other questions:
  • Write down a transfer function of a stable system for which pure proportional feedback could drive the system unstable.
    11·1 answer
  • A milling operation was used to remove a portion of a solid bar of square cross section. Forces of magnitude P = 18 kN are appli
    15·1 answer
  • You are considering building a residential wind power system to produce 6,000 kWh of electricity each year. The installed cost o
    15·1 answer
  • Define coordination number. How does this differ from atomic packing factor?
    7·1 answer
  • Python lists are commonly used to store data types. Lists are a collection of information typically called a container. Think of
    5·1 answer
  • - Consider a 2024-T4 aluminum material with ultimate tensile strength of 70 ksi. In a given application, a component of this mat
    7·1 answer
  • Can you screen record on WOW Presents Plus on iPhone?
    12·1 answer
  • Select the correct answer.
    6·1 answer
  • 4.7 If the maximum tensile force in any of the truss members must be limited to 22 kN, and the maximum compressive force must be
    9·1 answer
  • Ohm's law states that the current (I) in amps equals the voltage (E) in volts decided by the resistance (R) in ohm's. If you con
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!