Project #54737 - Java HW

Showcase Showdown!

 

Objective: 

Write a program which emulates the final game of a famous price related game show.  The program must read from a file (PriceList.TXT) and populate an array of 50 prizes.  Each item has an associate name and price, which is in the file and also in the order named.  The name and price are separated by a tab.  The program must then randomly pick 5 items out of that array for the showcase showdown, in which repeated items are allowed.  Then, the program must prompt the user with the names (individual prices hidden) of the prizes that have been randomly selected and ask them to enter the total cost closest without going over.  Since there is not another contestant in this version of the game, the program must also check to see if the price guessed is within $2,000 of the actual retail price or else they lose as well.  The game will continue until the user chooses to quit.

 

Suggested Methodology

You can solve this in any number of ways, and here’s a way you may take to approach this problem.

  • 3 Classes
    • Prize: This is a simple class which holds a single item from the list provided.  As such it has two instance variables prize and name, and also all the accessors, mutators, and constructors associated with it.
    • Showcase:  A more complex class which holds the arrays for the entire prize list and the randomly prize array that is the showcase.  Each array uses the type Prize.  This class must populate the entire prize array upon its construction from the file.  Also the file contains each prize name and cost separated by a tab.  A method for populating the showcase by randomly selecting items from the prize list is strongly recommended.
    • ShowcaseGame:  This is the entire front end of the game.  All of the users input and the prompts should go in this class which contains nothing more than a main method.

Example Dialog:

 

Welcome to the showcase show down!

Your prizes are:

milk

bread

car

car

car

You must guess the total cost of all without going over

Enter your guess

60000

You guessed 60000.0 the actual price is 60012.0

Your guess was under!  You win!

Would you like to play again? Enter 'no' to quit

yes

Welcome to the showcase show down!

Your prizes are:

moose

boat

bread

bread

bread

You must guess the total cost of all without going over

Enter your guess

40000

You guessed 40000.0 the actual price is 51021.0

I'm sorry but that guess was bad.  You lose for being bad.

Would you like to play again? Enter 'no' to quit

yes

Welcome to the showcase show down!

Your prizes are:

milk

moose

cheese

cheese

boat

You must guess the total cost of all without going over

Enter your guess

200000

You guessed 200000.0 the actual price is 51015.0

I'm sorry but that was over... You get nothing

Would you like to play again? Enter 'no' to quit

no

Goodbye

 

Submit the files to the drop box

 

PriceListTXT:

Car	20000
Boat	50000
Moose	1000
Goat	200
Shredded wheat 2
Cheese	5
Milk	5
Bread	7
Big TV	1000
Life time supply of Cheetos	2000
Lamp	20
Blender	30
Food Processor	40
Camera	400
Watch	750
Beard Supplies	800
Trip to Latvia	4000
Ski Equipment	1200
Pair of Scooters	2000
A basket of turtles	20
Fiber Supplement	6
Handful of hard candy	2
Large Ball of Foil	5
Heap of Makeup	100
A Pet Crow	50
A Trunk Full of Shoes	500
Trip to New Zealand	5000
Robosaurus	100000
Espresso Making Ferrets	1200
Antacid	5
A box of slightly used magazines	1
Pinball Machine	1500
Jar of Tomato Paste	5
Aspirin	8
Unreasonable amount of luncheon meat	200
Dinette Set	1400
Bedroom Set	1600
Washer and Dryer	1500
Microwave	30
Latest Video Game Console	500
Globe that lights up!	400
A sparkly necklace	800
Tennis Equipment	500
Cereal	4
The Antidote	250000
Ping Pong Table	400
A Very Very Pretty Ring	1200
Guitar	1500
Banjo	120
Exotic Plants	500
A Large Cowboy Hat	100

 

Subject Computer
Due By (Pacific Time) 01/25/2015 11:30 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy