Constructs Structs and Arrays You are the manager of a team of ten programmers who have just completed a seminar in structured programming and top-down design. To prove to your boss that these techniques pay off you decide to run the following contest. You number the programmers 1 through 10, based on their performance in the seminar (l is poorest, 10 is best), and monitor their work. As each does his or her part of your project, you keep track of the number of lines of debugged code turned in by each programmer. You record this number as a programmer turns in a debugged module. The winner of the contest is the first person to reach l000 lines of debugged code. (You hope this is programmer #9 or #10.) As further proof of the value of these new techniques, you want to determine how many poor programmers it takes to surpass the winner's figure; that is, find the smallest k such that programmers 1 through k (excluding the winner, if he/she is in the first k) have turned in more lines than the winner.   Input The input consists of a sequence of triples of integers. The first integer in each pair is the programmer's number (an integer from l to l0), and the second is the number of executable lines of code turned in, and the third has the number of lines of comments turned in. These numbers occur in the same order as that in which the modules were turned in Processing Read in integers until someone's total executable code goes over l000. Print out (echo print) each set as you read it. Ignore any input after someone's executable total exceeds 1000. Then print out a table listing the ten programmers and their totals, with the winner flagged as shown in the example that follows. Finally, find the smallest k such that the sum of the totals for programmers l-k  exceeds the winner's total. Print k in an explanatory sentence.   Partial Sample Output:    PROGRAMMER PROGRESS Programmer  Lines of Code Lines of Comments 10        230 100 . . 9         400 100     FINAL TOTALS Programmer  Lines of Code       Lines of Comment 1         51 2         105 3         309 4         101 5         215 6 7 It  took programmers  1  through  7  to produce more than the winner. txt file 10) 130 100 8) 106 45 7) 111 20 3) 187 100 9) 336 209 1) 51 67 10) 250 200 4) 201 190 9) 341 309 2) 105 100 8) 256 209 10) 450 197 3) 250 217 5) 215 202 7) 222 122 9) 200 123 10) 330 354 7) 100 98 2nd txt file 10) 230 100 8) 206 120 7) 111 50 3) 159 56 9) 336 200 1) 51 10 10) 250 123 4) 101 29 9) 341 190 2) 105 43 8) 256 122 10) 320 120 3) 150 19 5) 215 98 7) 222 108 9) 400 210 10) 330 125

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

Review of C++ ProgrammingProgram 1

 Constructs

Structs and Arrays

You are the manager of a team of ten programmers who have just completed a seminar in structured programming and top-down design. To prove to your boss that these techniques pay off you decide to run the following contest. You number the programmers 1 through 10, based on their performance in the seminar (l is poorest, 10 is best), and monitor their work. As each does his or her part of your project, you keep track of the number of lines of debugged code turned in by each programmer. You record this number as a programmer turns in a debugged module. The winner of the contest is the first person to reach l000 lines of debugged code. (You hope this is programmer #9 or #10.) As further proof of the value of these new techniques, you want to determine how many poor programmers it takes to surpass the winner's figure; that is, find the smallest k such that programmers 1 through k (excluding the winner, if he/she is in the first k) have turned in more lines than the winner.  

Input

The input consists of a sequence of triples of integers. The first integer in each pair is the programmer's number (an integer from l to l0), and the second is the number of executable lines of code turned in, and the third has the number of lines of comments turned in. These numbers occur in the same order as that in which the modules were turned in

Processing

Read in integers until someone's total executable code goes over l000. Print out (echo print) each set as you read it. Ignore any input after someone's executable total exceeds 1000. Then print out a table listing the ten programmers and their totals, with the winner flagged as shown in the example that follows. Finally, find the smallest k such that the sum of the totals for programmers l-k  exceeds the winner's total. Print k in an explanatory sentence.

 

Partial Sample Output:

   PROGRAMMER PROGRESS

Programmer  Lines of Code Lines of Comments

10        230 100

.

.

9         400 100

 

  FINAL TOTALS

Programmer  Lines of Code       Lines of Comment

1         51

2         105

3         309

4         101

5         215

6

7



It  took programmers  1  through  7  to produce more than the

winner.

txt file

10) 130 100

8) 106 45

7) 111 20

3) 187 100

9) 336 209

1) 51 67

10) 250 200

4) 201 190

9) 341 309

2) 105 100

8) 256 209

10) 450 197

3) 250 217

5) 215 202

7) 222 122

9) 200 123

10) 330 354

7) 100 98

2nd txt file

10) 230 100

8) 206 120

7) 111 50

3) 159 56

9) 336 200

1) 51 10

10) 250 123

4) 101 29

9) 341 190

2) 105 43

8) 256 122

10) 320 120

3) 150 19

5) 215 98

7) 222 108

9) 400 210

10) 330 125

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Structure chart
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.
Similar questions
  • SEE MORE QUESTIONS
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

Expert Answers to Latest Homework Questions

Q: A b. Observe the following reaction shown below. With aid of a mechanism, justify the…
Q: From the following data for the first-order gas- phase isomerization of CH3 NC at 215 °C, calculate…
Q: Draw the predominant product(s) of the following reactions including stereochemistry when it is…
Q: Knowledge Check 01 Use the drop-down menus to indicate whether each of the following events would be…
Q: 5. A train of mass 180t is moving at 90km/h. 5.1. Calculate the kinetic energy of the train. 5.2.…
Q: What is astrochemistry? a) The study of chemical reactions on Earth b) The study of chemical…
Q: Independent: They type of metal Dependent: Specific heat Control: According specific heat of the…
Q: Based on this model, households earn income when purchase in factor markets. Suppose Yvette earns…
Q: Find a polynomial function p which satisfies the following criteria: as x-x, p(x) - 88 The graph of…
Q: Please correct answer and don't use hend raiting and don't use AI solution
Q: in text form with proper workings and explanation for each and every part and steps with concept and…
Q: I need answer typing clear urjent no chatgpt used i will give upvotes
Q: Find Vx in this circuit and simplify the circuit by doing series/parallel connections.
Q: Dont use chat gpt to answer this question
Q:
Q: need all as
Q: Resource specialization and division of labor cause the marginal product of labor to increase, but…
Q: E2-20 (Algo) Recording Manufacturing Costs [LO 2-3, 2-4, 2-5] Reyes Manufacturing Company uses a job…
Q: ONLY ANSWER NUMBER 5 the other questions are there in case you need information and the data is…
Q: Please break this question down for me and draw the peptide too…….
Q: It has to be your own thoughts to answer this question.