CSCI231 Project Six: Methods Answered – Java Method Overloading & String Character Counting

$35.00

Explore Java method overloading through string character counting and case-insensitive letter matching. Covers overloaded countLetters methods, alphabetic character validation, invalid input handling, interactive user input, and repeated program execution. Delivered as a downloadable ZIP file containing the programming assignment solution for educational reference.

Original Work ?

Download Details:

  • Name: 6.ProjectSix-tldcwg.zip
  • Type: zip
  • Size: 19.42 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (5 votes)

CSCI231 Project Six: Methods focuses on Java method overloading and string processing through character counting functions. The assignment requires students to implement two overloaded countLetters methods, count English alphabetic characters, perform case-insensitive character matching, and handle invalid inputs. Students also develop an interactive test program using user input and repeated execution.

Assignment Description

The purpose of this project is to reinforce the knowledge from Chapter Six of the textbook. The
students are required to write the following two overloaded methods:

1. public static int countLetters(String s) which count the number of English letters in given
String s.
2. public static int countLetters(String s, char c) which count the number of English letter c
(not case sensitive) in given String s. If c is not an English letter, returns -1.
Write a test program with main function. When the program run, it shall run like: (The bold and
italic ones are input)

Enter a string: hello 123$% world
Enter a char: 3
The result of calling function int countLetters(String s) is: 10
The result of calling function int countLetters(String s, char c) is: -1
Do your want to do another test? Y/N: y
Enter a string: %$#1234567 89 Hello hays
Enter a char: h
The result of calling function int countLetters(String s) is: 9
The result of calling function int countLetters(String s, char c) is: 2
Submit the YourProj05.java file via Blackboard link. The due date will be announced on
Blackboard.

Solution Overview

The solution covers two overloaded Java countLetters methods for counting English letters and occurrences of a specified character regardless of case. It also addresses returning -1 for invalid characters and implementing an interactive main method with repeated testing.