Question: IN JAVA LANGUAGE PLEASE Problem : Write a program that plays the game Price IS Right. Requirements: Problem: Write a program that plays the game

IN JAVA LANGUAGE PLEASE

Problem: Write a program that plays the game Price IS Right.

Requirements:

Problem: Write a program that plays the game Price IS Right. Requirements: 1. You can create your own design as long as you have break down the problem in multiple methods. (6 or more methods) 2. Study chapter 6 so that you can read from a file. 3. Create two text files using notepad. One file will contains the name of the people (20) who might be selected to play. The other file will contains a list of the items (20) along with the price for each item. So the format for the file should be : 34 keyboard 600 laptop 4. Create a method that reads the names from the text file and store them in an array. 5. Create a method that reads the list of the items in the file and store them in an array. 6. Write a method that select four names randomly from the array that you just filled in. the selected names will be stored in an array with the length 4. 7. Write a method that selects a random item from the array that you created. 8. Write a method that displays the selected item. Also this method will get the players bids and stores them in an array called bids. The size of this array is 4 9. Write a method called priceIsRight that accepts the array of the players bids, the actual price of the item. This method finds the bid closest to the price of the item. and returns the index of the best bid 10. This method displays all the bids made by the player, the price of the item and the winner of the play. 11. Your main method should have only one method celled start. 12. Write a method that checks and see if there are any players left in the array name. 13. Start method will contain all the declarations, and method calls. a. You need to declare multiple arrays such as the followings: i. String[] names ii. String[] items iii. Double[bids] iv. String[] players

Notes: 1. The selected players must be unique at each round of the game. For example you cannot have Joe Alex Joe Mary as the players. You must make sure that you are not selecting a person who is already selected. 2. The description method must be very descriptive and must explain the rules of the game. . Please do not copy it from the sample output. 3. Create a text file with at least 20 names in it. 4. Create another text files with at least 20 items in there. This file will contain the item price and items name 5. Your output must be similar to the provided output. Meaning that all the prompts must be the same. 6. Must use printf to output the final result so that you have a nice format. 7. Must create your own text files of items and names 8. Refer to the file output.txt for the sample output.

this is what i have so far:

import java.util.*; public class PriceIsRight { static String Players = "player.txt"; static String items = "items.txt"; public static void main (String[] args) { Scanner kb = new Scanner(System.in); Random rand = new Random(); Description(); start(kb); } public static void Description() { System.out.println("You are about to play price is right game."); System.out.println("An item will be displayed on the secreen"); System.out.println("The players will enter their bids, whoever has the closest bid"); System.out.println("to the actual price will win."); System.out.println(); System.out.println(); System.out.println("Wait let me choose the players"); System.out.println(); System.out.println(); } public static void start(Scanner kb) { System.out.println("Here is the list of players:"); /*While (people want to play) { fill the array of items by reading from the text file fill the array of names by reading from the text file //some of your code While there are players left on the list { //some of your code Here is the pseudocode for the game: 4 people will be selected randomly from the list of the players, these four people must be remove from the list An item from the list of the items will be selected randomly. This item must be removed from the list of the items Each player is prompted to enter a bid The player with the closest bid to the actual price without going over will win. If the bids of all the players are less than or equal to the actual price { Same players will play again A new item will be selected (this item must be removed from the list } else Requirements: { If there are enough players left on the list All The selected players with the higher bid than the actual price will be Replaced If the numbers of the replace players is less than 4 New item must be selected. ] } Do you want to play again? } */ } public static void ListOfPlayers(Random rand) { } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!