2. Write a program that calculates marked area of the square, given input of square length and the diameter of the circle from the user. The value of diameter must be smaller than the square length. Calculate the marked area and display the result using number with 3 decimal points. In your program, declare Pi=3.142 as float data type. (Area of square = length , Area of circle = ar where n=3.14 and r=Ddiameter/2) length diameter length a) Draw the flowchart of the solution. b) Implement the algorithm designed in (a) in your program. Test and verify the completed program and write down your completed program.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 15E: (Program) Write a program to simulate the rolling of two dice. If the total of the two dice is 7 or...
icon
Related questions
Question
2. Write a program that calculates marked area of the square, given input of square length
and the diameter of the circle from the user. The value of diameter must be smaller than
the square length. Calculate the marked area and display the result using number with 3
decimal points. In your program, declare Pi=3.142 as float data type. (Area of square =
length? , Area of circle = ar? where a=3.14 and r=diameter/2)
length
diameter
length
a) Draw the flowchart of the solution.
b) Implement the algorithm designed in (a) in your program. Test and verify the
completed program and write down your completed program.
Transcribed Image Text:2. Write a program that calculates marked area of the square, given input of square length and the diameter of the circle from the user. The value of diameter must be smaller than the square length. Calculate the marked area and display the result using number with 3 decimal points. In your program, declare Pi=3.142 as float data type. (Area of square = length? , Area of circle = ar? where a=3.14 and r=diameter/2) length diameter length a) Draw the flowchart of the solution. b) Implement the algorithm designed in (a) in your program. Test and verify the completed program and write down your completed program.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr