Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The find_domain function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of the []
The find_domain 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.
(70 points) A fashion retailer has decided to provide discount codes to teachers and students during a promotional event. The first step is to verify the teacher/student status of people requesting discount code by their email addresses. They will check if the email addresses end with edu and find the domain name if it does before further verification Write a program to find the domain name of an email address if the domain name ends with .edu. The program displays domain that ends with edu. If the input does not contain an email address that ends with .edu, the program should display a message that indicates it is not a valid email address for the discount code. Example input/output: Input: jennifer23nyu.edu Output: nyu.edu Input: 1ohnA@facebook.com/ Output Not a valid email address for the discount code Your program should include the following function: int find domain (char *31, char 32); The find_domain function expects s1 to point to a string containing the input for an email address as a string and stores the domain to the string pointed by s2. If the email address does not end with edu, s2 should contain an empty string. An empty string is a valid string with no characters except the null character. The function returns 1 if the email addresses ends with .edu in the domain, and returns 0 otherwiseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started