30-Section-Handout

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

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

View Full Document Right Arrow Icon
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.
Image of page 1

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

View Full Document Right Arrow Icon
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,
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern