Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 = 106

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_2

Step: 3

blur-text-image_3

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions