- #1
remaan
- 132
- 0
Java Program Helpers Come in Please !
I am writting a program which asks the user to enter his email adress, and then prints - according to five conditions - if his address is valid or not .
1. there should be exactly one @ in the address he enters.
2. there should be at least one '.' after the @ but not immdetly after it
3. '.' can not be the last character in the address.
4. After @ there should be never two '.' in a row.
5. The @ should not be the first one.
The only thing I could think of is the last condition. I think I could that by using charAt(0)!= @
And, for the remaining conditions I thought about making a new method ?
using void so it does not return any thing, only checks
What do you think
Homework Statement
I am writting a program which asks the user to enter his email adress, and then prints - according to five conditions - if his address is valid or not .
1. there should be exactly one @ in the address he enters.
2. there should be at least one '.' after the @ but not immdetly after it
3. '.' can not be the last character in the address.
4. After @ there should be never two '.' in a row.
5. The @ should not be the first one.
The Attempt at a Solution
The only thing I could think of is the last condition. I think I could that by using charAt(0)!= @
And, for the remaining conditions I thought about making a new method ?
using void so it does not return any thing, only checks
What do you think