Question: The code for 10-2 can be found at the bottom 2) Remember that great application you wrote for Curly Q's (Lab 10-2)? They heard you

The code for 10-2 can be found at the bottom

2) Remember that great application you wrote for Curly Q's (Lab 10-2)? They heard you learned about definite iteration and want you to add it to the application. Start with your application or the application key. Modify the opening and closing messages to say Curly Q's, v2. Simulate a curling match with three ends. Within a for statement that loops three times, place the following existing logic:

The prompt for and read of the four integer coordinate pairs.

The calculation of the their distances from the origin.

The print of the stone distances by team.

The points each team scored.

At the start of each loop, show the current end within dashed lines. At the end of each loop, update and show the overall score for each team. The following example shows the end of End 2 and the start of End 3:

The code for 10-2 can be found at the bottom 2) Remember

After the loop, determine and show who won the match like the following:

that great application you wrote for Curly Q's (Lab 10-2)? They heard

Code:

#include  // For function getch() #include  // For several general-purpose functions #include  // For file handling #include  // For formatted output #include  // For cin, cout, and system #include  // For string data type using namespace std; // So "std::cout" may be abbreviated to "cout" int main() { // Declare constants const int COLFMT1 = 10; const int COLFMT2 = 6; // Declare variables string team1; string team2; int x; int y; double team1dist1; double team1dist2; double team2dist1; double team2dist2; int team1score; int team2score; // Format real numbers cout > team1; cout > team2; // Prompt for and get team 1, player 1 coordinates cout > x; cout > y; team1dist1 = sqrt((x * x) + (y * y)); // Prompt for and get team 2, player 1 coordinates cout > x; cout > y; team2dist1 = sqrt((x * x) + (y * y)); // Prompt for and get team 1, player 2 coordinates cout > x; cout > y; team1dist2 = sqrt((x * x) + (y * y)); // Prompt for and get team 2, player 2 coordinates cout > x; cout > y; team2dist2 = sqrt((x * x) + (y * y)); // Show team 1 stone distances cout   Canada stone distances Player 1: Player 2: 4.5 cnm 5.0 cm Sweden stone distances Player 1:11.4 cm Player 2: 8.6 cm eam scores after end 2 End eam Canada Swedern Total 4 0 0 END 3 Enter coordinates for Player 1 from Canada x coordinate (cm)7 y coordinate (cm): 5 Enter coordinates for Player 1 from Sweden . . x coordinate (cm): 3 y coordinate (cm): 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!