Enter (n)ame, (p)latform, (y)ear: n Enter a game name or part of a name: Zelda Matching games: Name: The Legend of Zelda: Ocarina of Time Platforms: Nintendo 64 Year: 1998 Name: The Legend of Zelda:...


need main class in java with user input that prints like the following in a (y/n) loop. reads from a txt file and second class


Enter (n)ame, (p)latform, (y)ear: n<br>Enter a game name or part of a name: Zelda<br>Matching games:<br>Name: The Legend of Zelda: Ocarina of Time<br>Platforms: Nintendo 64<br>Year: 1998<br>Name: The Legend of Zelda: Breath of the Wild<br>Platforms: Wii U Switch<br>Year: 2017<br>Name: The Legend of Zelda: Twilight Princess<br>Platforms: GameCube Wii<br>Year: 2006<br>Name: The Legend of Zelda: The Wind Waker<br>Platforms: GameCube<br>Year: 2003<br>Name: The Legend of Zelda: Majora's Mask<br>Platforms: Nintendo 64<br>Year: 2000<br>Do you want to search again? (y/n) y.<br>

Extracted text: Enter (n)ame, (p)latform, (y)ear: n Enter a game name or part of a name: Zelda Matching games: Name: The Legend of Zelda: Ocarina of Time Platforms: Nintendo 64 Year: 1998 Name: The Legend of Zelda: Breath of the Wild Platforms: Wii U Switch Year: 2017 Name: The Legend of Zelda: Twilight Princess Platforms: GameCube Wii Year: 2006 Name: The Legend of Zelda: The Wind Waker Platforms: GameCube Year: 2003 Name: The Legend of Zelda: Majora's Mask Platforms: Nintendo 64 Year: 2000 Do you want to search again? (y/n) y.
Proj8 java X<br>import java.util.*;<br>import java.io.*;<br>games bxt X<br>Game java X<br>2<br>3<br>Epublic class Game{<br>String name;<br>int yearj<br>4<br>5<br>6<br>String platforms;<br>Game (String name, String p, int year){<br>this.name = name;<br>platforms = p;<br>this.year = year;<br>}<br>7<br>9.<br>10<br>11<br>12<br>13<br>private String[] parsePlatforms (String s){<br>String[] platforms<br>return platforms;<br>}<br>14<br>15<br>s.split(

Extracted text: Proj8 java X import java.util.*; import java.io.*; games bxt X Game java X 2 3 Epublic class Game{ String name; int yearj 4 5 6 String platforms; Game (String name, String p, int year){ this.name = name; platforms = p; this.year = year; } 7 9. 10 11 12 13 private String[] parsePlatforms (String s){ String[] platforms return platforms; } 14 15 s.split(", "); %3D 16 17 18 E private String getPlatforms (){ } 19 20 21 22 E public String toString() { 23 24 25 26 E public boolean matchesYear (int y){ if(this.year == y) 27 28 29 return true; else return false; } 30 31 32 E public boolean matchesPlatform(String p){ if(this.platforms.contains(p)) return true; else return false; 33 34 35 36 37 } 38 public boolean matchesName (String str){ if(this.name.contains(str)) return true; 39 40 41 42 else return false; 43 } 44 45

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here