Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please solve it correctly in java Sample output: use student ID in the implementation. A company wants to develop an e-mail generator system. For example,
please solve it correctly in java
Sample output:
use student ID in the implementation. A company wants to develop an e-mail generator system. For example, when you want to generate a gmail account in Google, firstly you enter your name and surname. According to name and surname, the system might present you possible account address to be taken. In the company's system, it is asked you to develop a simple Java program which generates a gmail account by using Java String Class. The requirements of program are presented below. - Firstly, you have to create empty string object by using String Class - Then, check the string. If string is really empty, take input from the user. (inputs are name and surname). In this stage, the name and surname should be "Nurhani AHMD" respectively. Accordingly, your string object should be "Nurhani AHMD". - By using concat() method, add string of "@gmail.com" to your string object and display the result on console. (Finally, you should get "Nurhani AHMD @gmail.com") - According to implementation of gmail creation rules to generate possible gmail addresses, each character in the gmail account must be in lower case. For the creation of first possible account: You should remove the gap between "nurhani" and "ahmd". Then, display the result on console. For the creation of second possible account: You should add character of "_" between "nurhani" and "ahmd". For the creation of third possible account: You should add your student ID after "nurhaniahmd" and before "@gmail.com". Note That: For the second and third possible account creation, you should create an insert method. This method should divide the string into two parts. For example, if you want to add "_" between "nurhani" and "ahmd", you have to divide the whole string of nurhaniahmd@gmail.com into two parts such as "nurhani" and "ahmd@gmail.com" by using substring() method. Then, add string of "_" to "nurhani" and "nurhani_" to "ahmd@gmail.com". As a result, you will return the "nurhani_ahmd@gmail.com" from your insert method. - After that, you will just display each possible account and ask user to select one option. Please, investigate the sample outputs given below. Hint:You can use Java String Class's methods like concat(), toLowerCase(), replaceAll(), substring() and so on. please, enter name and surname: Nurhani AHMD Name \& Surname: Nurhani AHMD The gamil account is being generated... Current gmail account (Default): Nurhani AHMD@gmail.com 1. possible account: nurhaniahmd@gmail.com 2. possible account: nurhani_ahmd@gmail.com 3. possible account: nurhaniahmd12345678@gmail.com Select one of them: 2 Your gmail account is: nurhani_ahmd@gmail.comStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started