Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw High 2. For the 2nd task, begin by starting a new project and create one new source file named Lab1_Task2.c. Then create a new

image text in transcribed
image text in transcribed
Draw High 2. For the 2nd task, begin by starting a new project and create one new source file named Lab1_Task2.c. Then create a new source file with the same starting code as we used in Task 1 (figure 2). The goal of this second task will be to write a program that can find the estimated square footage of a persons home. To do this, we will have 4 functions. The prototypes for these, shown below, should be included between your preprocessor directives and the main function. int getLength: int getWidth(); int calculate Footage(int,int): void printArea(int); The next step will be defining these functions. Below main, lets build empty function definitions that we can complete next. These will be similar to the prototypes but the input variables will need names to go with their types and they will have enclosing brackets instead of a semi colon. int getLength return 0; 3 int getWidth return 0; } int calculate Footage(int length, int width) return 0; ) void printArea(int area) return 0; } void printArea(int area) } Next, just like with our first task, in these functions you should define the code needed to accomplish their task. In the first two get****** functions, you want to ask the user for an input with printf() then receive it from the user with a scanf() call. The calculation function should just run the calculation before returning the result. The print function should just print the resulting square footage to the terminal with printf() and a placeholder. If they have a return value, make sure to update your return call with the value you want sent back instead of our default O's we started with Once your sub functions have been defined, within main you can begin defining the program that ties them all together. We will need to store the width, length, and square footage, so 3 ints are needed. Then, it will be a matter of running the functions. Refer to the class example code for calling functions and retaining their return values

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

Students also viewed these Databases questions