Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please try to do it an easier way.start the code with:-- #include using namespace std; int main(){ Score the Race Introduction Some number of teams

image text in transcribed

image text in transcribed

Please try to do it an easier way.start the code with:--

#include using namespace std; int main(){

Score the Race Introduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: . Each team has a name, which is one of the uppercase letters A-Z. . No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same umber of members. No two runners cross the finish line at the same time-iethere are no ties. At the end of the race we can write the reaults as a string of characters indicing theonder in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A's runners finished in 3d, 5h and 6h place. Team Z's runners finished in 1, 2d and 4h place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z's runners achieved scores of 1, 2 and 4. Team A's runners scores were 3, 5, and 6 respectively. The team's score is the sum of the members score divided by the number of people on the team. So team A's score is (3+5+6)/3 = 143-466 and team Z's score is (1+2+4)/3=73-233 The Problem Write a program to score races as described above. Input Your program will ask the user to input a string of uppercase characters indicating the outcome of a race

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

Step: 3

blur-text-image

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

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions