Please help me to answer the following problems, I am new with the c++ code,

Write a c++ program that may be use to compute the area of square (area=sideside) or a triangle (area=1/2base*height). After prompting the user to type the first character of the figure name (S or T) if S you will compute the area of square, if T you will compute the area of trianglE.

I am new with the c++ code,

I'm also new , and new user can learn and finally becomes expert.And c++ is very easy to learn.

Write a c++ program that may be use to compute the area of square (area=sideside) or a triangle (area=1/2base*height).

i think nobody will write for you.you should do your homework with your own efforts.we will try to solve it ,if prove that you played much with the code but unable to find the solution.

After prompting the user to type the first character of the figure name (S or T) if S you will compute the area of square, if T you will compute the area of trianglE.

try this:

char ch;
cin>>ch;
if(ch=='s')
//call related function 
else if(ch=='t')
//call related function

subprogram is another term for function/subroutine. It is very easy to learn and Here is my tutorial on functions in c++.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.