Example Input Ann 10 Maria 6. Cindy Example Output Ann Example Input Ann 10 Maria 6. Cindy 10 Example Output Ann Cindy Example Input Ann 10 Maria 10 Cindy 10 Example Output Ann Maria Cindy

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
icon
Related questions
Question
Example Input
Ann
10
Maria
9.
Cindy
7
Example Output
Ann
Example Input
Ann
10
Maria
Cindy
10
Example Output
Ann Cindy
Example Input
Ann
10
Maria
10
Cindy
10
Example Output
Ann Maria Cindy
Transcribed Image Text:Example Input Ann 10 Maria 9. Cindy 7 Example Output Ann Example Input Ann 10 Maria Cindy 10 Example Output Ann Cindy Example Input Ann 10 Maria 10 Cindy 10 Example Output Ann Maria Cindy
Learning objectives
using if-else statements to find the highest score
• storing the input values to retrieve the name that corresponds to the highest score (potentially, in a data structure that makes this
easier)
Background
The problem presented in this lab is an active research area in Computer Science called differential privacy and secure (multi-party)
computation. In this lab, we won't be able to use a differentially private algorithm, so we will assume that the users stored their data secretly
somewhere and cannot see each other's values.
Instructions
Three friends finished the test and want to secretly compare their test scores. They do not want to know each other's exact score, but they
do want to know who achieved the best results for this test.
1. Firstly, all three friends will secretly input their names and scores one after another. (Check out the example input below)
2. Your program should store both names and scores. Think about types to store and structures to store (You can do it in many ways, but
we suggest tuples or namedtuples or just separate variables.
Hint! Check out previous comparison labs - the comparison here is almost the same.
3. Compare the scores and find the highest. A
3.1. If there is one best score - print the name of the friend that achieved that score.
3.2. If there are two friends with equal highest scores - print both names, separated by space, in the order of input.
3.3. If all three friends achieved equal scores - print all three names, separated by space, in the order of input.
%3D
Hints
• try to work with <, >, >=, <= and ==
• Use elif and/or nested ifs
Be careful with the indentation (i.e., the spaces before the blocks of code), especially in nested ifs.
Example Input
Transcribed Image Text:Learning objectives using if-else statements to find the highest score • storing the input values to retrieve the name that corresponds to the highest score (potentially, in a data structure that makes this easier) Background The problem presented in this lab is an active research area in Computer Science called differential privacy and secure (multi-party) computation. In this lab, we won't be able to use a differentially private algorithm, so we will assume that the users stored their data secretly somewhere and cannot see each other's values. Instructions Three friends finished the test and want to secretly compare their test scores. They do not want to know each other's exact score, but they do want to know who achieved the best results for this test. 1. Firstly, all three friends will secretly input their names and scores one after another. (Check out the example input below) 2. Your program should store both names and scores. Think about types to store and structures to store (You can do it in many ways, but we suggest tuples or namedtuples or just separate variables. Hint! Check out previous comparison labs - the comparison here is almost the same. 3. Compare the scores and find the highest. A 3.1. If there is one best score - print the name of the friend that achieved that score. 3.2. If there are two friends with equal highest scores - print both names, separated by space, in the order of input. 3.3. If all three friends achieved equal scores - print all three names, separated by space, in the order of input. %3D Hints • try to work with <, >, >=, <= and == • Use elif and/or nested ifs Be careful with the indentation (i.e., the spaces before the blocks of code), especially in nested ifs. Example Input
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole