30-Section-Handout

# 30-Section-Handout - CS106A Handout 30 May 9th 2011 Spring...

This preview shows pages 1–3. Sign up to view the full content.

CS106A Handout 30 Spring 2011 May 9 th , 2011 Section Handout Lab Problem 1: Exam Statistics Write a program that prompts an instructor to input the grades for the 40 students in her class, populates an array of type double and then outputs the mean of the exam and a histogram of the exam scores. The histogram should bucket exams into the ranges 0–9, 10–19, 20–29, and so forth, up to the range containing only the value 100. If, for example, the professor enters the data shown in the right margin, your program should then be able to generate the following output: I’ve given you a program that prompts the user for 40 scores (actually, I use a RandomGenerator to generate them—sneaky!) and prints the mean. It doesn’t require any arrays for that part at all. You’re to extend the program by introducing an array to manage the running histogram and then print that part out as well.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Lab Problem 2: Keith Numbers A Keith number is a number that appears in a Fibonacci-like series with initial terms based on its own digits. For example, 197 is a Keith number, and here’s proof: 1, 9, 7, 17, 33, 57, 107, 197 When asking whether or not 197 is a Keith number, you launch a sequence with its (in this case,
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern