Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Done in Java. Any help appreciated! Create a class named Lab3Exercises and Implement the following static methods (we will not use this class to instantiate

Done in Java. Any help appreciated!

Create a class named Lab3Exercises and Implement the following static methods (we will not use this class to instantiate objects) and write JUnit testswhen asked:

image text in transcribed

b) public static String computeBothEnds (String input) i. Write a static Java method that takes several words (or an entire line) as input and computes a word by combining first and last letter of each word. For example, if the given words (or line is "Hello, my name is Fred A Frank Flintstone", then your method should return "HomyneisFdAAFkFe". Notice that the comma and space are not part of the output. Ignore other special characters too and make sure your program can process both uppercase and lowercase letters. Words with single letter will have same letter for first and last. If there are no characters in input, then return null. ii. Use the Scanner class to get the input. You may use a loop if needed. iii. Test your method from main for both cases when it returns characters from both ends and also when it returns a null. iv. Write appropriate Junit tests

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

=+you think is being taxed when more money is printed? Why?

Answered: 1 week ago