Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Overview A group of chimpanzees at Gotham Zoo are given a series of tasks to perform every morning to test their mood and

1 Overview A group of chimpanzees at Gotham Zoo are given a series of tasks to perform every morning to test

1 Overview A group of chimpanzees at Gotham Zoo are given a series of tasks to perform every morning to test their mood and abilities to do work. There are 2 rooms (call them room A and room B) open to them each containing 4 tasks; the chimps learn that they immediately get a special treat when they complete any 5 tasks total out of both rooms. So each day they get to choose which tasks that they wish to complete. For each task that they successfully attempt a computer records their success in completing the task as a integer score in the range of 1-50 (inclusive). Unattempted tasks are indicated with a score of 0, and a negative score indicates a data error that usually indicates the chimp abused the equipment. Any trials with negative individual scores or no attempts are not counted in the overall statistics. Also if more tasks than required are completed, then the first ones completed in order are counted and the later ones are disregarded. Write a C program to read in each chimp's id number (a 4 digit value) followed by 8 scores (with each score being in the range 0-50 inclusive). An id number of 0 indicates the end of input. The data collection computer guarantees that the correct number of input values are always recorded and that the end-of-data is always indicated with a 0 for the id. Here is some sample input data: 2199 20 0 0 20 0 20 20 20 7001 0 0 0 0 0 0 0 0 7012 0 20 0 0 0 0 20 20 4000 -1-1-1 -1 -1 -1 -1 -1 1422 20 0 18 20 0 20 19 20 1372 -1 -1 18 11 0 20 0 20 0 Input to your program must come from standard input via redirection on the command line (as discussed in class; see the sample run below). You will echo print each student's id and scores along with printing out their result and all appropriate comments; do this in the table format shown in the sample run. Output, including all labels and spacings, must appear exactly as it appears in the sample run below. Depending on the data entered your program should also print out one of the following comments where appropriate (where n is the number of valid trials): Invalid trial. No attempts.

Step by Step Solution

3.36 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

Based on the provided context here is a C program that reads in each chimpanzees ID ... 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_2

Step: 3

blur-text-image_3

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

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

More Books

Students also viewed these Programming questions