mad libs with JAVA stuck with the giant loop to connect it. There was once a who in a . Everyone in the was of the , but no one had the to . So we past the and upon the , and everyone felt...


mad libs with JAVA


stuck with the giant loop to connect it.


There was once a who in a .
Everyone in the was of the ,
but no one had the to . So we
past the and upon the ,
and everyone felt about their lot in life, until, of course,
the descended upon us like and took
from us. Rue that day! Rue it .




//STORY TIME<br>else {<br>try {<br>Scanner fsc = new Scanner(new File(
coolStory = new ArrayList(); //the new redone story while (line.contains("<") &&="" line.contains("="">")) { String part = "."; if (line.charAt(line.length()-1) =='.' || line.charAt. length()-1 ==',') { // for adi rnd = coolStory.add(adjs()); } else if (line.charAt(line.length()-1) ='.' || line.charAt. length()-1 ==',') { // adverb } else if (line.charAt(line.length()-1) ='.' || line.charAt.length()-1 ==',') { // singnoun } else if (line.charAt(line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { // plunoun } else if (line.charAt (line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { /I singverb } else if (line.charAt (line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { /I pluverb } else if (line.charAt(line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { // pastverb } "/>
Extracted text: //STORY TIME else { try { Scanner fsc = new Scanner(new File("story" + option +".txt")); System.out.println(); while (fsc.hasNextLine()) { line = fsc.nextLine(); String[] parts = line.split(" "); ArrayList coolStory = new ArrayList(); //the new redone story while (line.contains("<") &&="" line.contains("="">")) { String part = "."; if (line.charAt(line.length()-1) =='.' || line.charAt. length()-1 ==',') { // for adi rnd = coolStory.add(adjs()); } else if (line.charAt(line.length()-1) ='.' || line.charAt. length()-1 ==',') { // adverb } else if (line.charAt(line.length()-1) ='.' || line.charAt.length()-1 ==',') { // singnoun } else if (line.charAt(line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { // plunoun } else if (line.charAt (line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { /I singverb } else if (line.charAt (line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { /I pluverb } else if (line.charAt(line.length()-1) =='.' || 1line.charAt.length()-1 ==',') { // pastverb }
*Untitled - Notepad<br>File Edit Format View Help<br>public ArrayList<String> readWordList(String fname) {<br>try {<br>ArrayList<String> results = new ArrayList<String>();<br>Scanner fsc = new Scanner(new File(fname));<br>for each line in the fsc you just opened:<br>add the line to the results list<br>close the fsc<br>return results;<br>} catch (Exception ex) {<br>return null;<br>}<br>}<br>in main<br>ArrayList<String> adjs = readwordList(
advs = readwordList("adv.txt"); do { ask them what they want if they chose i show them the instructions else { try { Scanner fsc = new Scanner(new File("story" + what they typed in + ".txt")); for each line in the file replace the , , etc with random words from the adjs, advs, etc. lists } catch (Exception ex) { say the file didn't exist } } while they chose not to quit "/>
Extracted text: *Untitled - Notepad File Edit Format View Help public ArrayList readWordList(String fname) { try { ArrayList results = new ArrayList(); Scanner fsc = new Scanner(new File(fname)); for each line in the fsc you just opened: add the line to the results list close the fsc return results; } catch (Exception ex) { return null; } } in main ArrayList adjs = readwordList("adj.txt"); ArrayList advs = readwordList("adv.txt"); do { ask them what they want if they chose i show them the instructions else { try { Scanner fsc = new Scanner(new File("story" + what they typed in + ".txt")); for each line in the file replace the , , etc with random words from the adjs, advs, etc. lists } catch (Exception ex) { say the file didn't exist } } while they chose not to quit

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here