[Solved]C Carnival Games Problem B2 Focus One One Le Main Game Point Point Circle Class Behavior N Q37144384
C++
Carnival Games
In Problem B2 you should focus only one one file – the main game. Atthis point all the Point and Circle class behavior you need toimplement should be implemented and correct. This will leave youfree to focus on designing helpful functions to support you infinishing problem B2. Main game Finally, you should have a mainmethod in a file hw8b.cpp that does the following:
1. First it should prompt the user for a file name. The file shouldcontain up to 1000 circles in the following format:
centerX centerY radius color
So the file snippet
-53.49 166.57 10.13 Yellow 58.29 230.2 71.84 Green
has two circles, a Yellow circle centered at (-53.49, 166.57)with radius 10.13 and a Green circle centered at (58.29, 230.2)with radius 71.84.
2. Once the program has loaded the circles it should give the userthree chances to input coordinates for their next dart. You willfind it convenient to use a Point2d to represent this.
3. Once the user inputs a dart placement, it needs to find whichcircle the dart hit. If the input point is not in any circle it wasa miss (and the user should be notified of this) If the point iswithin multiple circles, the circle it ”hits” is the one with theclosest center. Note, the circle with the closet center (of all thecircles) may not be hit if the point is not within that circle(I.E. the dart hit close to, but outside, of a small radius circle,and is therefore inside of a nearby big radius circle).
4. The number of points the user gets is based on what they hit: •A miss earns no points, • Hitting a red colored circle is worth 10points • Hitting a yellow colored circle is worth 5 points •Hitting a green colored circle is worth 2 points • Hitting a graycolored circle loses 1 point (I.E. is worth -1 point). 5. Afteradding to the score, every circle that overlaps with the hit circle(and the hit circle itself) should have their color set to graybefore the next dart.
6. After three darts their total score should be shown to theuser.
Examples Example 1
Input file name: Circle1.dat
Round: 1
Points: 0
Where do you throw the dart (x y): 10 10
Hit: [Red c=(8.73701, 14.2111) r=58.5273]
Round: 2
Points: 10
Where do you throw the dart (x y): 20 20
Hit: [Gray c=(17.8014, 15.8503) r=45.5107]
Round: 3
Points: 9
Where do you throw the dart (x y): 30 30
Hit: [Gray c=(24.0746, 34.6441) r=30.5087]
Out of darts!
Points: 8
Expert Answer
Answer to C++ Carnival Games In Problem B2 you should focus only one one file – the main game. At this point all the Point and Ci… . . .
OR

