Example Input Ann 10 Maria 9 Cindy 10 Example Output Ann Cindy Example Input Ann 10 Maria 10 Cindy 10 Example Output Ann Maria Cindy

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
**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.

   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.

**Hints**

- try to work with `<`, `>`, `>=`, `<=` and `==`
- Use `elif` and/or nested `if`
- Be careful with the indentation (i.e., the spaces before the blocks of code), especially in nested `if`s.

**Pseudocode**

Get the 6 input values (3 names with the test scores corresponding to each name), run the comparison to find the highest score and then retrieve/print the name (or names) that corresponds to that score.

**Example Input**

```
Ann
10
Maria
9
Cindy
7
```
Transcribed Image Text:**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. 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. **Hints** - try to work with `<`, `>`, `>=`, `<=` and `==` - Use `elif` and/or nested `if` - Be careful with the indentation (i.e., the spaces before the blocks of code), especially in nested `if`s. **Pseudocode** Get the 6 input values (3 names with the test scores corresponding to each name), run the comparison to find the highest score and then retrieve/print the name (or names) that corresponds to that score. **Example Input** ``` Ann 10 Maria 9 Cindy 7 ```
**Example Output:**

Ann

---

**Example Input:**

Ann  
10  
Maria  
9  
Cindy  
10  

**Example Output:**

Ann Cindy

---

**Example Input:**

Ann  
10  
Maria  
10  
Cindy  
10  

**Example Output:**

Ann Maria Cindy

---

*(Note: The examples illustrate processing input-output pairs, where names are associated with numerical values used for determining the output order.)*

*Image ID: 354684.2028158.q3cxy7*
Transcribed Image Text:**Example Output:** Ann --- **Example Input:** Ann 10 Maria 9 Cindy 10 **Example Output:** Ann Cindy --- **Example Input:** Ann 10 Maria 10 Cindy 10 **Example Output:** Ann Maria Cindy --- *(Note: The examples illustrate processing input-output pairs, where names are associated with numerical values used for determining the output order.)* *Image ID: 354684.2028158.q3cxy7*
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education