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]
2 years 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]2 years 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
A stress researcher wants to look at the effect of meditation on anxiety. To do this, she creates two groups of subjects: one gr
mariarad [96]

Answer:

Independent, dependent

Explanation:

The mediation conditions are what affect anxiety hence anxiety is dependent on mediation. The main aim of the researcher is to see how anxiety levels of people vary depending on the meditation. In this case, meditation conditions are independent variables. Therefore, it's proper to conclude that the meditation vs no meditation conditions are independent variables while anxiety is dependent variable

6 0
4 years ago
Energy is generated uniformly in a 6 cm thick wall. The steady-state temperature distribution
mezya [45]

Answer:

Heat generation per unit volume is 45 KW.

Explanation:

Given that

Thickness of wall = 6 cm

Temperature distribution

T(z)=145+3000z-1500z^2    -----1

K= 15 W/m.k

As we know that at steady state condition

\dfrac{d^2T}{dz^2}+\dfrac{q}{K}=0   -----2

Where q is the heat generation per unit volume.

So from equation 1

\dfrac{dT}{dz}=3000-3000z

\dfrac{d^2T}{dz^2}=-3000

Now from equation 2

\dfrac{d^2T}{dz^2}+\dfrac{q}{K}=0  

-3000+\dfrac{q}{15}=0  

So q= 45 KW

So heat generation per unit volume is 45 KW.

6 0
3 years ago
Joseph wants to practice architecture. Which compulsory assessment administered by NCARB does he need to complete?
Hunter-Best [27]

Answer:

Architect Registration Examination (ARE)

Explanation:

In this scenario, Joseph wants to practice architecture. A compulsory assessment administered by National Council of Architectural Registration Boards (NCARB) which he has to complete is an Architect Registration Examination.

An Architect Registration Examination (ARE) refers to the professional licensure examination to be taken by anyone who intends to practice architecture in the United States of America, Puerto Rico, Guam, Canada, US Virgin Islands.

The main purpose of the Architect Registration Examination is to assess an architect's knowledge, skills, and abilities on architectural best practices, procedures and services. Also, it focuses on areas relating to a building's safety, soundness and health impact on the habitants. Therefore, ARE is a prerequisite for practicing architecture across the United States of America jurisdiction.

Once an architect passes the examination, he or she would be given a license to practice architecture.

<em>Hence, for Joseph to practice architecture he must take the Architect Registration Examination developed and administered by National Council of Architectural Registration Boards (NCARB). </em>

8 0
3 years ago
Which of the following statements are true concerning AC circuit that contains both resistance and inductance? A. The current an
maw [93]

The current will lag the voltage in AC circuit that contains both resistance and inductance.

Answer: C

Explanation

There is no inductance only circuits in reality.

The circuits containing inductance has also a lower amount of resistance.

The current flows in both resistance and inductance.

There is a drop in the total voltage in resistance and inductance giving rise to the voltage applied in the coil when connected in a series.

An example being inductance coil an AC circuit connected to both resistance and inductance in series.

From the vector diagram, this conclusion can be drawn.

3 0
3 years ago
g Calculate a better value for the convection coefficient using resources from heat transfer. Assume forced convection of the ai
ollegr [7]

Answer:results for h should on the same order of magnitude of the value I provided. If it isn't, check your units. Update to you calculated values for h and resolve your model.

Explanation:

4 0
3 years ago
Other questions:
  • The term motion refers to a change in position with respect to a. a specific reference b. the ground c. the center of the Earth
    14·1 answer
  • Two sections, A and B, are 0.5 km apart along a 0.05 m diameter rough concrete pipe. A is 115 m higher than B, the water tempera
    12·1 answer
  • If the student releases the rocks, which rock will land on Earth's surface
    9·1 answer
  • 1. The area of the given triangle is 25 square units. What is the value of x?<br> X+2
    8·1 answer
  • The contractor was awarded a contract to construct a parking lot for a small shopping center. The contractor plans to use single
    13·1 answer
  • Free brainlyest...........................​
    13·1 answer
  • Which statement is WRONG?
    13·1 answer
  • Which symbol warns that there is something wrong with your alternator?
    8·1 answer
  • Why exam is important in our life
    14·2 answers
  • What is the definition of gross axle weight rating?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!