This is not a writing assignment so it should not be rejected for being as such. Write a main method and a complete static method named printRepeat that work together as described here. Include pseudo code to show how you planned to do the work. main should prompt the user using a Scanner170 object to ask for a single letter between a and z (lower case) from the keyboard input; if the user enters anything else reprompt until they enter a proper input. Main also creates a second Scanner170 object to read from a file called repeat.txt (provided with the exam). Finally, main calls the printRepeat method with the second Scanner170 and the input letter and prints out the value returned from printRepeat. printRepeat takes as parameters a Scanner170 object and a one letter long String; it returns a int.  The method reads lines of text from the Scanner170 object it received as a parameter. Each line read consists of a number and a string (separated by at least one blank). The method should work with any number of lines in the Scanner170 object (including zero). For each line read, the method prints out to the user “>>: “ followed by the string from the file duplicated number of times on a single line. The string read from the file may contain any symbols including special characters and numbers. The method also checks to see if the string from the file contains the letter it was given as second parameter. Keep count of how many lines in the file have letter included in their string.  When the entire file has been processed, return that count to the calling program. Be sure main and all methods include clear pseudo code to show your plan. See example output below (the results depend on what letter the user enters for matching): *** Use proper programming style and test your code until you believe it works correctly *** Example run produces something like this:

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter4: Making Decisions
Section: Chapter Questions
Problem 1DE: Each of the following files in the Chapter.04 folder of your downloadable student files has syntax...
icon
Related questions
Question

This is not a writing assignment so it should not be rejected for being as such.

Write a main method and a complete static method named printRepeat that work together as described here. Include pseudo code to show how you planned to do the work.

main should prompt the user using a Scanner170 object to ask for a single letter between a and z (lower case) from the keyboard input; if the user enters anything else reprompt until they enter a proper input. Main also creates a second Scanner170 object to read from a file called repeat.txt (provided with the exam). Finally, main calls the printRepeat method with the second Scanner170 and the input letter and prints out the value returned from printRepeat.

printRepeat takes as parameters a Scanner170 object and a one letter long String; it returns a int.  The method reads lines of text from the Scanner170 object it received as a parameter. Each line read consists of a number and a string (separated by at least one blank). The method should work with any number of lines in the Scanner170 object (including zero). For each line read, the method prints out to the user “>>: “ followed by the string from the file duplicated number of times on a single line. The string read from the file may contain any symbols including special characters and numbers. The method also checks to see if the string from the file contains the letter it was given as second parameter. Keep count of how many lines in the file have letter included in their string.  When the entire file has been processed, return that count to the calling program.

Be sure main and all methods include clear pseudo code to show your plan.

See example output below (the results depend on what letter the user enters for matching):

*** Use proper programming style and test your code until you believe it works correctly ***

Example run produces something like this:

For the input file:

    

В Аle
4 4x4
O Nothing
1 alone
2 better
Transcribed Image Text:В Аle 4 4x4 O Nothing 1 alone 2 better
Enter a single letter for me to watch for in the file:
e
>>: AppleAppleApple
>>: 4x44x44x44x4
>>:
>>: alone
>>: betterbetter
printRepeat processed the file and returned: 3
Transcribed Image Text:Enter a single letter for me to watch for in the file: e >>: AppleAppleApple >>: 4x44x44x44x4 >>: >>: alone >>: betterbetter printRepeat processed the file and returned: 3
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning