I still don't understand what I'm doing wrong. Can anyone please just correct the original code I posted in this
thread? It's literally just an error with one line...
PLEASE HELP! I'm getting desperate bc the semester is over in a week and this public class error thing for the name of the project code is only thing holding me back from getting it 100 percent correct.
I appreciate the feedback so far but will someone actually run my code through their compiler or just tell me what to fix!?
Again these are the errors that I am getting from the textbook publisher's website for three projects:
1. (Process a string ) Write a program that prompts the user to enter a string and displays its length and its first character .
"StringLength.java:3: error: class ProgrammingEx4_20 is coderanch, should be declared in a file named ProgrammingEx4_20.java
public class ProgrammingEx4_20 {"
for
2. Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers , determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number.
"AvgWithLoop.java:3: error: class ProgrammingEx5_1 is coderanch, should be declared in a file named ProgrammingEx5_1.java
public class ProgrammingEx5_1 {"
for
3. (Occurrences of a specified character ) Write a method that finds the number of occurrences of a specified character in a string using the following header:
public static int count(String str, char a). Add a main method to the class that tests the method by prompting for a string and a character , invoking the method and printing the returned count.
"CharCounter.java:3: error: class ProgrammingExercise6_23 is coderanch, should be declared in a file named ProgrammingExercise6_23.java
public class ProgrammingExercise6_23 {"
for
PLEASE HELP!