You have been asked to write the code that performs this validation for email and password. You decide to write a function named “valid_ address” and “valid_password” that accepts the e-mail address and password as an argument respectively and returns either true or false, to indicate whether they are valid or not. If all are valid save it in a file named “accounts.txt” open the file with ‘a’ mode to append the new account without deleting the already existed in the file, each student in separate line, and separate student’s information by white space.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

***python code***

Question1:

The university, ask the student to enter his/ her e-mail address then check if it valid or not

the address must meet the following requirements:

  • end by @ksu.edu.sa,
  • it must contain exactly 9 digits.

If the address is valid ask them to type a valid password for the campus computer system, the password must meet the following requirements:

  • The password must be at least seven characters long.
  • It must contain at least one uppercase letter.
  • It must contain at least one lowercase letter.
  • It must contain at least one numeric digit.

When a student sets up his or her password, the password must be validated to ensure it meets these requirements.

You have been asked to write the code that performs this validation for email and password. You decide to write a function named “valid_ address” and “valid_password” that accepts the e-mail address and password as an argument respectively and returns either true or false, to indicate whether they are valid or not.

If all are valid save it in a file named “accounts.txt” open the file with ‘a’ mode to append the new account without deleting the already existed in the file, each student in separate line, and separate student’s information by white space.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 5 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr