Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(IN JAVA) Write a program named Review.java and implement the following methods: public static boolean isValidTicTacToeBoardString(String str) This method takes as its parameter a String

(IN JAVA) Write a program named Review.java and implement the following methods: public static boolean isValidTicTacToeBoardString(String str) This method takes as its parameter a String that contains 9 characters representing the status of the Tic Tact Toe game. The String is mixed with X, O, x, o, and other letters. The first three letters represent the first row, letter 4 through letter 6 represent the second row, and the rest for the last row. To be considered as a valid status, the String must meet the following condistions: 1. The absolute difference between the number of Xs and the number of Os must be either 0 or 1 2. There is only one or none player meeting the "win" condition (row, colum, diagonal) public static char[][] buildTicTactToe2DBoard(String str) This method takes as its parameter a String that contains 9 characters. The String is mixed with X, O, x, o, and other letters. If the argument string is valid board string, then construct a 2D arrray to represent the board. Use a peroid (.) to replace all other letters in the 2D array. For example, the string "XX9pOoOxR" should return the following 2D array: X X . . O O O X . public static int countWord(String word, File file) This method counts and returns the number of occurrence of the word in the file. A data file: wordCOunt.txt is provided for testing. public static int[] coutingGrades(File file) This method takes as its parameter a file containing grades for a class, then counts how many grades are in each of the following categories and returns them as a 5-element int array: [90 - 100] [80 - 89] [70 - 79] [60 - 69] [Below 60] This method returns Design a java program named GradeCount.java to read data from a gradebook (gradebook.txt contains grades only) and count how many students are in each of the following categories: 90 - 100 80 - 89 70 - 79 60 - 69 Below 60 Here is the sample data file: 82 100 88 90 56 76 67 60 2000 98 65 90 85 67 81 93 86 88B 87 70 88 78 84 76 81 89 Please note the file may contains some invalid data and your program should discard those invalid data: less than 0 or greater than 100, or non-numerical data. Once completed, please run Grader.class to test your program and record the result in result.txt under the assignment folder.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions