Hello, can you correct my codes, into inheritance please i am begging you help me. I badly needed it please Laboratory Exercise Guessing Game 2 Objective: At the end of the exercise, the students should be able to: Create a simple game that exhibits file input and output. Software Requirements: Latest version of NetBeans IDE Java Development Kit (JDK) 8 Procedure: 1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive. 2. Create a new project named LabExer6A. Set the project location to your own folder. 3. Create a simple guessing game (similar to Hangman or Hangaroo). In this game, the user guesses a letter and then attempts to guess the word. 4. Create a Notepad file named words.txt which will store any number of words each written per line. 5. The Java program shall: • randomly select a word from the list saved in words.txt; • display a letter in which some of the letters are replaced by ?; for example, ED??A??ON (for EDUCATION); • place the letter in the correct spot (or spots) in the word each time the user guesses a letter correctly; • inform the user if the guessed letter is not in the word; and • display a congratulatory message when the entire correct word has been deduced. Here's my code import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { char guess; File file = new File("word.txt"); Scanner input = new Scanner(file); String words[] = input.nextLine().split(","); Random r1 = new Random(); int value =r1.nextInt(words.length); String phraseSolution = words[value]; StringBuilder phrase = new StringBuilder(""); for(int i=0;i= 1) { validation = true; } return validation; } }
Hello, can you correct my codes, into inheritance please i am begging you help me. I badly needed it please Laboratory Exercise Guessing Game 2 Objective: At the end of the exercise, the students should be able to: Create a simple game that exhibits file input and output. Software Requirements: Latest version of NetBeans IDE Java Development Kit (JDK) 8 Procedure: 1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive. 2. Create a new project named LabExer6A. Set the project location to your own folder. 3. Create a simple guessing game (similar to Hangman or Hangaroo). In this game, the user guesses a letter and then attempts to guess the word. 4. Create a Notepad file named words.txt which will store any number of words each written per line. 5. The Java program shall: • randomly select a word from the list saved in words.txt; • display a letter in which some of the letters are replaced by ?; for example, ED??A??ON (for EDUCATION); • place the letter in the correct spot (or spots) in the word each time the user guesses a letter correctly; • inform the user if the guessed letter is not in the word; and • display a congratulatory message when the entire correct word has been deduced. Here's my code import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { char guess; File file = new File("word.txt"); Scanner input = new Scanner(file); String words[] = input.nextLine().split(","); Random r1 = new Random(); int value =r1.nextInt(words.length); String phraseSolution = words[value]; StringBuilder phrase = new StringBuilder(""); for(int i=0;i= 1) { validation = true; } return validation; } }
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Hello, can you correct my codes, into inheritance please i am begging you help me. I badly needed it please
Laboratory Exercise
Guessing Game 2
Objective:
At the end of the exercise, the students should be able to:
Create a simple game that exhibits file input and output.
Software Requirements:
Latest version of NetBeans IDE
Java Development Kit (JDK) 8
Procedure:
1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive.
2. Create a new project named LabExer6A. Set the project location to your own folder.
3. Create a simple guessing game (similar to Hangman or Hangaroo). In this game, the user guesses
a letter and then attempts to guess the word.
4. Create a Notepad file named words.txt which will store any number of words each written per line.
5. The Java program shall:
• randomly select a word from the list saved in words.txt;
• display a letter in which some of the letters are replaced by ?; for example, ED??A??ON
(for EDUCATION);
• place the letter in the correct spot (or spots) in the word each time the user guesses a letter
correctly;
• inform the user if the guessed letter is not in the word; and
• display a congratulatory message when the entire correct word has been deduced.
Here's my code
import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args) throws Exception
{
char guess;
File file = new File("word.txt");
Scanner input = new Scanner(file);
String words[] = input.nextLine().split(",");
Random r1 = new Random();
int value =r1.nextInt(words.length);
String phraseSolution = words[value];
StringBuilder phrase = new StringBuilder("");
for(int i=0;i= 1)
{
validation = true;
}
return validation;
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY