Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use c++ for coding. It would be very appreciated if basic loop is use instead bits/stdc++.h library You will be creating a main() function
Please use c++ for coding.
It would be very appreciated if basic loop is use instead "bits/stdc++.h" library
You will be creating a main() function to practice basic loops, mathematical formula implementation, and basic outputs. You will submit ONE file on Canvas called LastName_Firstname_HW1B.cc (or.cpp). Instructions: 1. Start with a circle of radius = 1. 2. Circumscribe an equilateral triangle, (n = 3) around the circle 3. Circumscribe a circle around the triangle. 4. Circumscribe a square (n = 4) around the circle 5. Circumscribe a circle around the square. 6. Circumscribe a pentagon (n = 5) around the circle. 7. Keep going until n = 1,000,000 (106) 8. Print out the circle radii for n = 10, 100, 1000, 10000, 100000, 106. Diagram showing the first two polygons (triangle, square) and the first three circles: r be 12 Example Output: n = 10 Radius = XX.XXXXX n = 100 Radius = XX.XXXXX n = 1000 Radius = XX.XXXXX n = 10000 Radius = XX.XXXXX n = 100000 Radius XX.XXXXX Radius = XX.XXXXX (Where XX.XXXXX is the value) n = 106 You will be creating a main() function to practice basic loops, mathematical formula implementation, and basic outputs. You will submit ONE file on Canvas called LastName_Firstname_HW1B.cc (or.cpp). Instructions: 1. Start with a circle of radius = 1. 2. Circumscribe an equilateral triangle, (n = 3) around the circle 3. Circumscribe a circle around the triangle. 4. Circumscribe a square (n = 4) around the circle 5. Circumscribe a circle around the square. 6. Circumscribe a pentagon (n = 5) around the circle. 7. Keep going until n = 1,000,000 (106) 8. Print out the circle radii for n = 10, 100, 1000, 10000, 100000, 106. Diagram showing the first two polygons (triangle, square) and the first three circles: r be 12 Example Output: n = 10 Radius = XX.XXXXX n = 100 Radius = XX.XXXXX n = 1000 Radius = XX.XXXXX n = 10000 Radius = XX.XXXXX n = 100000 Radius XX.XXXXX Radius = XX.XXXXX (Where XX.XXXXX is the value) n = 106Step 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