Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm stuck on this part of my assignment and wanted to see how this code is set up because I am now lost. It might
I'm stuck on this part of my assignment and wanted to see how this code is set up because I am now lost. It might be different from what you have because I've gotten help here before and it helped a bit. Thank you.
Step 1: Remove switch.cpp from the project and add the areas.cpp program in your Lab4 folder to the project. This file contains just a program shell in which you will write all the programming statements needed to complete the program described below. Here is a copy of the current contents of areas.cpp. 1 Lab 4 areas. cpp 2 WRITE A COMMENT BRIEFLY DESCRIBING THE PROGRAM 3 PUT YOUR NAME HERE 4 INCLUDE ANY NEEDED FILES HERE 5 using namespace sta; 7 int main DEFINE THE NAMED CONSTANT PI HERE AND SET ITS VALUE TO 3.14159 10 DECLARE ALL NEEDED VARIABLES HERE. GIVE EACH ONE A DESCRIPTIVE 11 NAME AND AN APPROPRIATE DATA. TYPE 13 WRITE STATEMENTS HERE TO DISPLAY THE 4 MENU CHOICES 14 15 WRITE A STATEMENT HERE TO INPUT THE USER'S MENU CHOICE 16 17 18 USE AN IF/ELSE IF STATEMENT TO OBTAIN ANY NEEDED INPUT INFORMATION AND COMPUTE AND DISPLAY THE AREA FOR EACH VALID MENU CHOICE 19 IF AN INVALID MENU CHOICE WAS ENTERED AN ERROR MESSAGE SHOULD 20 21 BE DISPLAYED 22 23 return 0; 24 Step 2: Design and implement the areas. cpp program so that it correctly meets the program specifications given below. Specifications: Sample Run Create a menu-driven program that finds and Program to calculate areas of objects displays areas of 3 different objects. Square The menu should have the following 4 choices: circle 1 Square ight triangle 2 circle quit 3 right triangle quit Radius of the circle 3.0 If the user selects choice 1, the program Area 28.27 43 should find the area of a square If the user selects choice 2, the program should find the area of a circle. If the user selects choice 3, the program should find the area of a right triangle If the user selects choice 4, the program should quit without doing anything. If the user selects anything else (i.e., an invalid choice) an appropriate error message should be printedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started