Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 04: Write an interactive C program that displays the following menu: 1. Find area of a triangle 2. Find volume and surface area of

image text in transcribed
Task 04: Write an interactive C program that displays the following menu: 1. Find area of a triangle 2. Find volume and surface area of a sphere. Please select your choice (1 or 2): The program then reads the menu choice and behaves as in the following table: Menu choice Program behavior The program prompts for and reads the lengths of the three sides of a triangle. It then computes and displays the area the triangle. Given a triangle with sides a, b, and c, Heron's formula for the triangle area is: S (a+bt )/2 The program prompts for and reads the radius r of a sphere. It then computes and displays the volume and the surface area of the sphere. [ Vohme r 3.14159 Surface Area Input other than 1, and 2 The program displays the following error message : Error: Wrong menu choice and then terminates Note: Assume that the values read by the program for options I, and 2 are in centimeters. For these options, your program must display appropriate units in the output. Solve the problem using switch-statement, then solve it again using multi-way if statement

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions

Question

Describe the three tax systems.

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

1. Define and explain culture and its impact on your communication

Answered: 1 week ago