Answered step by step
Verified Expert Solution
Question
1 Approved Answer
graded out of30 points if not submitted during lab time Write a program, LablPartC.cpp, that stores 3 integers: side (of a square), length and width
graded out of30 points if not submitted during lab time Write a program, LablPartC.cpp, that stores 3 integers: side (of a square), length and width (of a rectangle). The values for these integers are entered by the user. Then modify it as follows: C.1: Functions with int as a return datatyge: Write a function called that accepts an integer representing the length of the side of a square as a parameter and calculates the area, then returns the area ofthat square. This function should not have any print statements. In your function print the area returned from this function without storing the returned value in a variable. C.2: Functions with bool as a return datatyge: Write a function called that accepts an integer representing the length of the side of a square as a parameter and calculates the area of that square. This function returns true if the calculated area is greater than 20. The function should not have any print statements. In your function print the statement '"I'he area is larger than 20\" if the value returned by the function is true, or \"The area is less than or equal 20\" otherwise. Do not use (== true) in your if statement, how would this work? Why? Can you rename this function in this program as , why (not)? Some Sample Outputs for the Programs are: Enter side, width and length: 5 10 20 Enter side, width and length: 4 S 8 Area of square with side 5 is 25 The area is larger than 20 Area of rectangle:2@0 Area of square with side 4 is 16 The area is less than 20 Area of rectanglez40
Step 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