Question
I am stuck at how to make sure it populate data of the prizes followed b its format at the read file section. Please help!
I am stuck at how to make sure it populate data of the prizes followed b its format at the read file section. Please help!
Objective:
Write a program which replicates the final game of a famous price related game show. In this version, a Showcase contains exactly 5 unique randomly selected prizes. The user must guess the sum of the prizes within $1,300 below or equal to the sum in order to win.
Requirements:
Functionality. (80pts)No Syntax, Major Run-Time, or Major Logic Errors. (80pts*)
*Code that cannot be compiled due to syntax errors is nonfunctional code and will receive no points for this entire section.
*Code that cannot be executed or tested due to major run-time or logic errors is nonfunctional code and will receive no points for this entire section.
Use only Arrays. (80pts*)
*Other built in types like ArrayLists, LinkedLists, etc will receive no points for this entire section.
Clear and Easy-To-Use Interface. (10pts)
Users should easily understand what the program does and how to use it.
Users should be prompted for input and should be able to enter data easily.
Users should be presented with output after major functions, operations, or calculations.
Users should be able to perform any number of the required functions. In addition, users should be able to choose when to terminate the program.
All the above must apply for full credit.
Reading a Prize File. (20pts)
The program must read from a Prize File and using that information it must populate a data structure of prizes.
Each prize in the file has a name and price separated by and end line ( ).
Each prizes name and price are separated by a tab (\t)
The Prize File format is:
<
<
The program should ignore items that do not strictly follow the previously stated format. (HINT! Theres at least one item in the file that is not formatted correctly)
Example Prize File
You may either assume the Prize File is constant or you may ask the user to enter a prize filename.
All the above must apply for full credit.
Select Prizes for the Showcase. (20pts)
The program should randomly pick exactly 5 unique prizes from the prize data structure.
No prize should ever repeat in this selection.
All the above must apply for full credit.
Determine if the user won or lost. (20pts)
The user must be presented with the prizes names before they make a guess, and it must clearly prompt the user for a guess.
The user should be able to enter their guess.
The program then must determine if the users guess was less than or equal the sum of the prizes and greater than or equal the sum of the prizes minus $1,300. If both are true, then the program must inform the user they won! Otherwise the program must inform the user they lost.
For Example, if sum of the prizes is $5,000 then the user wins if their guess is between $3,700 and $5,000 inclusively, otherwise they lose.
All the above must apply for full credit.
Run-Time and Logic Error Checking. (10pts)
Each major function must check for common run-time and logic errors.
Coding Style. (10pts)
Code functionality organized within multiple methods other than the main method, and methods organized within multiple classes where appropriate. (5pts)
Readable Code (5pts)
Meaningful identifiers for data and methods.
Proper indentation that clearly identifies statements within the body of a class, a method, a branching statement, a loop statement, etc.
All the above must apply for full credit.
Prize File:
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 200 Dollars in Cash 200 Bag of 100 Tacos 200
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started