Question: C + + 1 4 . 1 . 2 : Exception basics. 5 8 2 8 8 0 . 4 2 5 8 2 9
C
: Exception basics.
qxzqy
Jump to level
Strings yourUsername and yourDomain are read from input. Complete the try block to output "Sending email to followed by yourUsername and yourDomain with error checking:
If yourUsername's length is or throw a runtime exception with the message "User name's length must be between and
If yourDomain does not start with @ throw a runtime exception with the message "Domain must start with @
Ex: If input is Amir @leek, then the output is:
Sending email to Amir@leek
Ex: If input is Svetlana @leek, then the output is:
Error: User name's length must be between and
Ex: If input is Amir lettuce, then the output is:
Error: Domain must start with @
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
