Write a program that has the main method and another method called parseString.
The parseString method:
• is public
• is static
• does not return a value
• has one parameter of type String
• takes the individual characters in the String passed as an argument, capitalizes them and separates them by a hyphen
• it then prints the resulting string to the output console
For example, if the method was called from the main method passing the string “hello”, it should print to the output console the string: “H-E-L-L-O”.
To test the parseString method, you may call it multiple times from the main method passing different strings.
The following is the header for the method:
public static void parseString(String str)
// provide your implementation here
My solution involved writing a for loop to get the individual characters in the String argument.
I also used the length, charAt and toUpperCase methods of the String class; as well as the toString method in the Character class to convert a char value to a String value.
You, of course, don’t have to use the same solution I did, but make sure that your method works correctly regardless of the string that is passed as an argument.
Möchten Sie Geld verdienen?
- Legen Sie Ihr Budget und Ihren Zeitrahmen fest
- Skizzieren Sie Ihr Angebot
- Bekommen Sie Geld für Ihre Arbeit
Angebote auf dieses Projekt
I consider myself a responsible, creative, with initiative and punctuality, I accept with pleasure the challenges and goals that you/your organization could assign me, with good handle of the interpersonal relationships, ability to work in team, ability to work under high pressure, so as to solve problems efficiently and achieve the goals set by you/your company and my work group.
Hi, good to see you :) Want to work with us? We at Techxygen do what we do best. Our versatile team consists of talented individuals, each one having a unique skill set. Our areas of expertise: 1. Android/iOS application development 2. Web site development 3. Game development 4. Problem solving 5. Big data Once we commit to a task, we leave it only after finishing it. Come work with us and you will realize the quality that we provide and the value that we give to our clients. Thanks for visiting our profile :)
Looking for an unrivalled and meticulous Java/C++/Android Developer ? Well you got one ! I'm a proficient programmer with multifaceted experience and excellence in: • Android development ( Material Design and Latest Tools support ) • JAVA SE/EE • C# MVC / Web API • C++/VC++ • Enterprise and Multi-tier Software Architecture • Sql and NoSql Databases • UML Modeling and Schema Designs • RESTful Services • Web development (CMS/Wordpress, PHP, Frontend Design/Revamping, Fixations) i'll do any sort of project ranging from Course assignments to Professional-Grade Challenges with eminence & perfection. UI/UX, Documentation and everything else will be well taken care of. Along with that, i'am an unrivaled Transcriptionist VA and you'll get your productivity jobs done as per your Expectations !
I have good experience with -C -C++ -Android -Java -Website Development -SQL I have been working as a Developer for many years. I am a hard worker. If hired by you I will be responsible to complete the task within the stipulated time frame and with utmost confidence. Outsource me for your project and I promise to bring in the best output.
I am very much qualified .NET,JAVA and Android Developer. I have a solid ability set and establishment in specified fields as I have been working with these for a long time. I likewise have extraordinary involvement in web Development. On the off chance that enlisted by you I will invest my best exertion and convey amazing work.As of now I have gathered a team of thorough professionals who are as committed motivated and skilled as I am .we are in gelled up like unit who canget the work done !
Description: We specialize in Mobile Applications, Software Product Development, Logo Designing and data scrapping services. Our team also consists of expert Writers and Logo Designers with a taste for modern elegance. Our first priority is to satisfy our clients. Expertise: We have extensive experience in PHP, ASP.Net, Java, WordPress, ROR, Joomla, Big/ECommerce Android, iOS, Magneto, Drupal, Windows, Unity3d, 3d Max, 3d Maya, C#, C++, Python, Linux, Databases, VB and Web Crawling Data Scrapping Services.