Welcome to Computer Programming

 

Bowlers Delight Project - 10 points

 

Starter code at bottom - create a method called BowlerStat

public void BowlerStat()


It will ask bowlers to input scores until they type in -1. Each time they enter a grade, comment on it by saying:

  • If they enter 0-100 tell them they bowl great (for a 4 yrd old)
  • if they enter 101-150 tell them its decent.
  • 151-199 tell them its very impressive
  • 200-249 tell them they spend way too much time bowling.
  • 250-300 tell them they are a liar.
  • If it is out of that range, tell them scores only go from 0-300.
  • If the score is valid: keep track of it:

At the end you will display average, number of games played, and the high score and the low score.

 

 

Rubric:

This counts as a 10 point project:

  • 1 instructions given
  • 1 has necessary variables
  • 1.5 ask users repeatedly until they type in -1
  • 2.5 average works correctly
    • average calculated (1 points)
    • -1 not calculated in average (.5 points)
    • invalid scored not calculated in average (.5 points)
    • double used correctly (like if scores are 5 and 10, average is 7.5) (.5 points)
  • 1 high score works
    • invalid scores dont affect high score (.25 points
  • 1 low score works
    • invalid scores dont affect high score (.25 points)
  • 1 it displays correct messages
  • .5 indented
  • .5 variables named correctly

 

Advanced or extra credit: (do at least one)

  • Streak meter - at the end say how many games their scores have been improving for (like if they type 234, 200, 212,245 it would say Your have improved for 3 games in a row
  • doubles - so if you type in scores of 184, 190, 184 it would say - you already got that score or something; its tough - read about arraylists(here)
  • learn about files and store and save your results for next time.
  • Anything else you can think that would be useful/cool.

 

Notes for Bowler Stat:

Give instructions
Ask for a score
Read it in
declare variables before loop (numOfGames played, totalScore, highScore, lowScore)
while loop (while they dont put in -1)
    comment on it (if statements) [say they did great, or whatever]
    if valid
        add to your total
        num of games played goes up by one
        alter high score, low score if necessary
    ask for a score
    read it in
find average
spit out.
          
/*
 * @author Jeff Borland   -> Replace w/ your name
 * @version 1.711
 */
 
import java.util.Scanner;
public class BowlersDelight
{
    public static void BowlerStat()
    {
        Scanner scan=new Scanner(System.in);  
    } 
 
}