Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions