Question: Project 5, Program Design 1. (50 points) A store has decided to provide discount codes to university students during a promotional event. University students can

 Project 5, Program Design 1. (50 points) A store has decided

Project 5, Program Design 1. (50 points) A store has decided to provide discount codes to university students during a promotional event. University students can submit their request for their unique discount codes (associated with their email address) by entering their university email address on the store's website. Write a program to verify if the domain name of an email address ends with .edu. The program should display a message that indicates whether it is a valid email address for the discount code. Example input/output: Input: lily23@yahoo.com Output: Not eligible for discount code Input: joe1997@mail.usf.edu Output: Verification successful Input: vpatel@fsu.edu Output: Verification successful 1) Name your program validate_email.c. 2) Your program should include the following function: int validate(char *s1); The validate function expects si to point to a string containing the input for an email address as a string. If the email address ends with .edu, the function returns 1 and returns 0 otherwise. The validate function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of the () operator in the function 3) Assume input is no longer than 1000 characters. Assume the input contains no more than one qualifying web address 4) String library functions are NOT allowed for this program. If you use a string library function, you will NOT receive the credit for the validate function part of the program. 5) To read a line of text, use the read_line function (the pointer version) in the lecture notes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!