Question: Java! Write a program that asks the user to enter a string, and then asks the user to enter a character. The program should count

Java!

Write a program that asks the user to enter a string, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the string. Requirements (20 points) 1) If your code does not compile, you will lose 10 points. 2) It is your responsibility to come see me for help if you need it. Do not work with another student or request help from any other individual. 3) (1 point) The source code file must be named CharCounter.java. This also means that the public class is named CharCounter! 4) (1 point) Include a proper Javadoc comment at the top of the source code that has a description of the program (what is the purpose of the program?) and includes your name. 5) (2 points) Prompt the user for the input string and read in the string. The prompt must be userfriendly and descriptive! 6) (2 points) Prompt the user for the character to count and read in the character. (Hint: Java does not provide a way to read in individual characters. This means the character will need to be read in as a String and then extracted.) The prompt must be user-friendly and descriptive! 7) (5 points) Use a loop to count the number of times the character appears in the string. You will likely find it helpful to review the String methods that were covered in Chapter 2. 8) (1 point) Display the number of times the character appears in the string using a descriptive sentence. 9) (4 points) Design and Implementation. The program must be well designed. This includes descriptive variable names, useful comments including general comments and Javadoc comments, clear and user-friendly output to the user, good flow of the program, efficient use of code, etc. 10)(4 points) Organization. The program must be well organized. This includes good layout, consistent and clean indenting using spaces, appropriately aligned curly braces and headers, lines of code 80 characters or less, etc. I recommend you open the file in a basic text editor (Notepad on Windows) before submitting to make certain the layout is clean and consistent. See Blackboard for more information on good programming practices. Do not use any constructs that have not been discussed in class in your code (methods, arrays, etc.). If you use any Java code that has not been discussed in class, you will lose points. Submit the source file in Blackboard Log into Blackboard and go to our course page. Under Content in the left menu, navigate to the module that contains this programming assignment (Week 8). Click on the assignment for Programming Assignment 4. Under Assignment Submission, use Browse My Computer next to Attach File and find the .java file. Only submit the .java file! When the file has been attached, click the Submit button.

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!