Question: IN JAVA, the input txt is named p4.txt and the starter code is given. The input text is: Weve got the answers to your questions

IN JAVA, the input txt is named p4.txt and the starter code is given.
The input text is:
Weve got the answers to your questions Luddy Hall 700 N. Woodlawn Avenue Bloomington, IN 47408 812-856-5754 luddy@indiana.edu People directory Contact individual faculty and staff members. Myles Brand Hall 901 E. Tenth Street Bloomington, IN 47408 Parking The parking garage thats closest to most of our buildings is the Eleventh and Fee Garage. Luddy Undergraduate Office Admissions and campus visits 812-855-6159 Admissions and campus visit questions: luddyrec@indiana.edu Advising 812-856-2613 luddyadv@indiana.edu Records Questions about records, including readmission, certification, and graduation: siceugrd@indiana.edu Career Services Luddy Hall, first floor 812-856-4903 luddycareers@indiana.edu Development and Alumni Relations 812-856-5909 Luddy Graduate Office On-campus students Admissions GoLuddy@iu.edu 812-856-3960 Advising & Student Services Current graduate students: gradvise@indiana.edu 812-855-4841 Monday-Friday 8am-5pm Online students Schedule an admissions or advising appointment 812-856-5953 Admissions luddyonl@indiana.edu Advising & Student Services siceooe@indiana.edu


The input file contains the text of the Luddy contact page. Write a program that 1. reads this file and 2. print the total number of immediately repeating characters. Immediately repeating characters is two occurrence of the same character in succession without any other character between them. For example "admissions" has "ss" as the immediately repeating characters, "abba" has "bb" as the immediately repeating characters. In your program write and use the following method : returns the count of repeating characters in str Example: - countRepeatingCharacters("admission") -> 1 // repeating characters are "ss" - countRepeatingCharacters("admission was successful") -> 3// Repeating characters are "ss" in "admission" and "cc" and "ss" in "successful". - countRepeatingCharacters("www") -> 2 // Repeating characters are "ww" and "ww" input: file3-1.txt . You must download this file, save it in the files subfolder in the project folder and provide this filename to the Scanner in the starter code. pousages public static void main(String[] args) throws FileNotFoundexception \{ Scanner in = new scanner(new File( pathname: "files/")); // declare and infitialize variables if needed while(in. hasNextLine())\{ String line = in.nextLine(); // add your code here in.close(); // print the output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
