Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. Write a C++ program that repeatedly prompts for and reads an e-mail address an

ID: 3632017 • Letter: #

Question

. Write a C++ program that repeatedly prompts for and reads an e-mail address and then determines and displays whether the address is valid or invalid. For purposes of this program, an e-mail address is valid if it satisfies these conditions:
• The address cannot contain blanks. For example, john smith@minneapolis.edu is not a valid e-mail address.
• The @ character must occur exactly once. For example, baz.cs.dpu.edu and bar@cs@dpu are not valid e-mail addresses.
• The @ character cannot be the first character of the address. For example, @cs.dpu.edu is not a valid e-mail address.
• Every occurrence of the dot character (.)must have a non-@, non-dot character on both side.

Explanation / Answer

#include #include using std::cin; using std::cout; using std::endl; using std::string; int main(void) { string emailAddress; bool isValid = true; bool hasAtSymbol = false; coutemailAddress; for(int i = 0; i