Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a. Write function that reads hight and the base and calulate volum the triangle object . Hint: volum= *hight* base. B. In main: Define

a. Write function that reads hight and the base and calulate volum the triangle object .

Hint: volum= ½ *hight* base.

B. In main:

  • Define object of type triangle (triObj).
  • Define Pointer object of type triangle (ptr).
  • Let ptr points on triObj.
  • Call function read for object triObj.
  • Print the infotmation of the triObj using pointer ptr. (base,hight ,volum)


 Suppose you have following code: [5 marks]

struct triangle

{

int hight;

int base;

double volum;

};


Step by Step Solution

3.45 Rating (148 Votes )

There are 3 Steps involved in it

Step: 1

Heres a description of how you can write a C program to achieve the specified tasks include Define t... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Algorithms questions

Question

Find the derivatives of the function. 9 cot sin t t

Answered: 1 week ago