Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CMPSC 201 - Spring 2019 Labs 1-3 makeup To be done individually Due by end of your recitation section on 2/8/19. Goals: Practicing variable definitions

image text in transcribed
CMPSC 201 - Spring 2019 Labs 1-3 makeup To be done individually Due by end of your recitation section on 2/8/19. Goals: Practicing variable definitions (declarations), built-in functions, error checking and switches. Problem: Create a program that will calculate the area of an equilateral triangle, square, or circle based on the user's input. The user should be prompted to enter a T for triangle, an S for square, or C for circle. Use a single-branch (simple) if or a while loop to confirm the user has entered a correct character. You may assume that the user entered an upper case character. You should also prompt the user to enter the units. Next use a switch structure to calculate the area for the shape entered. Inside the branch for the triangle, the user should be prompted to enter a value for the side of the triangle. Then use a use a single-branch (simple) if or a while loop to confirm the user has entered a valid value for the side of the triangle. Inside the branch for the square, the user should be prompted to enter a value for the side of the square. Then use a use a single-branch (simple) if or a while loop to confirm the user has entered a valid value for the side of the square. Inside the branch for the circle, the user should be prompted to enter a value for the radius of the circle. Then use a use a single-branch (simple) if or a while loop to confirm the user has entered a valid value for the radius of the circle. No "else" should appear in your code. Your output should contain the entered shape and dimension plus the area similar to "A square with a side of 2.5 inches has an area of 6.25 square inches." Make sure that your code follows the Assignment Guidelines posted on Canvas. Do not use any concepts beyond Chapter 5 in your textbook. Attach your C++ file to the Assignment on CANVAS. Remember to confirm all your submissions to CANVAS Labs 1-3 Makeup CMPSC 201-Spring 2019

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

Genomes Browsers And Databases Data Mining Tools For Integrated Genomic Databases

Authors: Peter Schattner

1st Edition

0521711320, 978-0521711326

More Books

Students also viewed these Databases questions

Question

Describe the new structures for the HRM function. page 676

Answered: 1 week ago