ProjJ1_BowlersDelight :
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, range, and the high score and the
low score.
Rubric. This counts as a project! - 16 points:
- 1 instructions given
- 1 has necessary variables
- 2 ask users repeatedly until they type in -1
- 4 average works correctly
- average calculated (1 points)
- -1 not calculated in average (1 points)
- invalid scored not calculated in average (1 points)
- double used correctly (like if scores are 5 and 10, average is 7.5) (1 points)
- 1.5 high score works
- invalid scores dont affect high score (.5 points
- 1.5 low score works
- invalid scores dont affect high score (.5 points)
- 2 it displays correct messages
- 1 indented
- 2 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.
- Make it more graphical. Using this about gui and this about textarea
- 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
* @date 2.16
*/
import java.util.Scanner;
public class ProjJ1_BowlersDelight
{
public void BowlerStat()
{
Scanner scan=new Scanner(System.in);
}
}
|