Question: Write a program that creates usernames for new email addresses: Create two variables, one that stores your first name ( as a String ) and

Write a program that creates usernames for new email addresses:
Create two variables, one that stores your first name (as a String) and another that stores the last 4 digits of your student number (as an integer). Print them.
Using selection statements, check if the length of your first name is greater than 7 characters
If it is longer than 7, square root the student number variable and cast it to an integer.
If it is less than or equal to 7, divide the student number variable by 100 and then square the number (using a Math method).
Finally, concatenate your first name, the resulting student number, and "@algomau.ca". Print this final email address in the console to report it to the user.
 Write a program that creates usernames for new email addresses: Create

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!