Question: Hi I need help with a program I can't seem to run it I keep getting a error: AuthoringAssistant.java:14: error: invalid method declaration; return type

Hi I need help with a program I can't seem to run it I keep getting a error:" AuthoringAssistant.java:14: error: invalid method declaration; return type required public static printMenu(Character[] menu) { ^ 1 error"

can someone make it runable and send me screen shot of it please

and can you use the same language im new to java

HERE IS THE FULL CODE TO COPY

import java.util.Scanner;

public class AuthoringAssistant {

public static void main(String[] args) { Scanner sc = new Scanner(System.in); String userInput = sc.nextLine(); System.out.println("Enter a sample text: "); System.out.println(userInput);

return printMenu; }

public static printMenu(Character[] menu) { Scanner in = new Scanner(System.in); Character userChar = in.nextLine().charAt(0); System.out.println("MENU"); System.out.println("c - Number of non-whitespace characters"); System.out.println("w - Number of words"); System.out.println("f - Find text"); System.out.println("r - Replace all !'s"); System.out.println("s - Shorten spaces"); System.out.println("q - Quit"); System.out.println("Choose an option: ");

if (userChar == 'q') { System.out.println("q"); System.out.println("Quit"); } else if (userChar == 'w') { System.out.println("w"); System.out.println("Number of words: "); } else if (userChar == 'f') { System.out.println("f"); System.out.println("Find text: "); } else if (userChar == 'r') { System.out.println("r"); System.out.println("Replace all !'s: "); } else if (userChar == 's') { System.out.println("s"); System.out.println("Shorten spaces: "); } else if (userChar == 'c') { System.out.println("c"); System.out.println("Number of non-whitespace characters: "); } else { System.out.println("Please select a valid character."); }

return in.nextCharacter(); } }

Hi I need help with a program I can't seem to run

our Code 1 imart java.uti.Sranner; 3 public class AuthoringassistantR 5-public ctatic void main(Stringi argc) Scanner sc new Scanner(System.in) string userInput sc.nextline) System.nlrt.nrintIn("Fnter5nmpletext: "); Sys Lem.ouL-priiLin(userInpul) return printMenu; 13 14 public atotic printMenu (Character] mcnu) 15 16 17 Scanner in new Scanner(System.in); Charat Ler user Charin.nexLline(harAL(e) System.out.printin("MENU) System.out.printin("c Number of non-whitespace characters"); System.out.printin"w Number of words") System . out . printin("t F1na text"); Syst.out "print1n("r Replace a11 !'5"); System.out.println("s Shorten spaces; System.out.printin("q Quit ystpmout-println("honse an option: 19 21 23 04 Svstem.out.printin("a): System.out-println("Quit") 2/ 29 30 31 32 else ir (userCharw) System.nut nrint 1n("w): Sys Lem.uuL.print"Numer uf wurus:") 34 35 36 37 System.out.println(") System.out.println("Find text: 39 48 SysLem.uul.println(") Syctem.out.printin("Replace all ':": else if (uerChar) System.out.printin("s) System.out.printin("Shorten spaces: "); 45 47 19 51 System.out.println(") system.out.printin("Number or non-whitespace characters: ) Systcm.out.println("Plsc sclcct a volid character."), 52 return in.nextChararter)

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!