Question

Convert the below 3 statements in English to c++ equivalent. a) The area of a rectangle is given as area = width x height You
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a) The area of a rectangle is given as area=width*height
You are given the variable double A,wd,ht.
  
C++ Statement:- double A,wd,ht;
A=wd*ht;


(b) The Surface area of a cube is given as area=2ab+2ac+2bc
where a,b,c are the lenght,width and height.
you are given the variable double A,a,b,c.
  
C++ Statement:- double A,a,b,c;
A= 2*a*b + 2*a*c + 2*b*c;
  

(c) The volume of a regular pyramid is given as V=(1/3)(w*l*h).
You are given the variable double V,w,l,h;

C++ Statement:- double V,w,l,h;
V= (w*l*h)/3.0;

Add a comment
Know the answer?
Add Answer to:
Convert the below 3 statements in English to c++ equivalent. a) The area of a rectangle...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT