Instructor: Todd Dole
This assignment will involve String operations. We will learn how to use indexOf and substr to do basic manipulations of Strings.
Create a new program with a class called GetName. Your source code file should be named GetName.java
In many organizations, email addresses are created using the format: firstName.lastName@organization.com Hardin-Simmons uses this format for faculty and staff email addresses (e.g. todd.dole@hsutx.edu) In this exercise, you will write a program that prompts the user for an email address in this form. You will then use indexOf and substr to extract the first name and last name, and print them separately.
Example Output:
Please enter email address (in the form firstname.lastname@org.com): todd.dole@hsutx.edu
First Name: Todd
Last Name: Dole
For this assignment, you can assume that the user enters a valid email address in the correct format.
Upload your solution (your MakeChange.java source code file) to the assignment in Canvas.
Before you begin:Write out the steps that you will follow. Hint: How can you use indexOf to find the end of the first name and the start of the last name? How can you use substr to extract the first name once you know this? How can you use indexOf to find the end of the last name? Include your plan in comments at the start of your file.
Upload your completed GetName.java file through Canvas.