Computers and Technology

Score the raceintroductionsome 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 number of members. no two runners cross the finish line at the same time – i. e. there are no ties. at the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. for example: zzazaawe can see there were two teams: a and z. team a’s runners finished in 3rd, 5th and 6th place. team z’s runners finished in 1st, 2nd and 4th place. scoring the raceeach 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 = 14/3=4.66 and team z’s score is (1+2+4)/3=7/3=2.33the problemwrite a program to score races as described above. inputyour program will ask the user to input a string of uppercase characters indicating the outcome of a race. outputyour program will output:  the number of teams. the number of runners on a team. the names of the teams – in alphabetical order - together with the team score. the name and score of the winning team. so for the example above the program will print: there are 2 teams. each team has 3 runners. team scorea 4.66z 2.33the winning team is team z with a score of 2.33.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:30, alexandramendez0616
Jasper and samantha are in a robotics competition. the guidelines state that the robots should be able to move a 10-gram weight at least 2 meters and turn in a circle. jasper and samantha have already built the robot. which step of the design process should they follow next to decide whether their robot meets the minimum criteria for the competition?
Answers: 1
image
Computers and Technology, 22.06.2019 10:00, adam4449
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
image
Computers and Technology, 22.06.2019 12:10, Geo777
1. package newton’s method for approximating square roots (case study 3.6) in a function named newton. this function expects the input number as an argument and returns the estimate of its square root. the script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key. 2. convert newton’s method for approximating square roots in project 1 to a recursive function named newton. (hint: the estimate of the square root should be passed as a second argument to the function.) 3. elena complains that the recursive newton function in project 2 includes an extra argument for the estimate. the function’s users should not have to provide this value, which is always the same, when they call this function. modify the definition of the function so that it uses a keyword parameter with the appropriate default value for this argument, and call the function without a second argument to demonstrate that it solves this problem. 4. restructure newton’s method (case study 3.6) by decomposing it into three cooperating functions. the newton function can use either the recursive strategy of project 1 or the iterative strategy of case study 3.6. the task of testing for the limit is assigned to a function named limitreached, whereas the task of computing a new approximation is assigned to a function named improveestimate. each function expects the relevant arguments and returns an appropriate value. 5. a list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor. define a predicate issorted that expects a list as an argument and returns true if the list is sorted, or returns false otherwise. (hint: for a list of length 2 or greater, loop through the list and compare pairs of items, from left to right, and return false if the first item in a pair is greater.)
Answers: 1
image
Computers and Technology, 23.06.2019 07:00, bskyeb14579
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
Do you know the correct answer?
Score the raceintroductionsome number of teams are participating in a race. you are not told how man...

Questions in other subjects: