{"id":68028,"date":"2021-10-30T14:45:56","date_gmt":"2021-10-30T14:45:56","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/10\/30\/program-design\/"},"modified":"2021-10-30T14:45:56","modified_gmt":"2021-10-30T14:45:56","slug":"program-design","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/10\/30\/program-design\/","title":{"rendered":"Program Design"},"content":{"rendered":"<p>Write a program to check if an email address read from a file is a UCLA email, an email that contains ucla.edu. The output file should contain all the UCLA email addresses read from the input file. You can assume email addresses in the file are valid email addresses. <br \/>Example input\/output: <br \/>Enter input file: <br \/>emails1.txt <br \/>Output: <br \/>output file name is UCLA_emails1.txt <\/p>\n<p>Technical requirements: <br \/>1. Name your program UCLA_emails.c <br \/>2. Prompt the user to enter a file name for the input file. <br \/>3. The output file name should be the same name but with an added prefix of <br \/>UCLA_. For example, if the input file name is emails.txt, the output file name <br \/> should be UCLA_emails.txt. <br \/>4. Assume the input file name is no more than 100 characters. <br \/>5. Read the emails from the file. Email addresses are stored in separate lines. <br \/>6. Assume length of email addresses is no more than 2000 characters. <br \/>7. The program should include the following function: <br \/>int is_UCLA_email(char *email); <br \/>The function expects email to point to a string containing an email address. The <br \/>function returns 1 if email address contains ucla.edu, and returns 0 otherwise. String <br \/>library functions are allowed. <br \/>8. In the main function, call is_UCLA_email function and write the email address to the <br \/>output file if it is an UCLA email. <br \/>## <br \/>#. The program should begin with a comment that briefly summarizes what it does. <br \/>#. In most cases, a function should have a brief comment above its definition <br \/> describing what it does. Other than that, comments should be written only needed <br \/>in order for a reader to understand what is happening. <br \/>#. Information to include in the comment for a function: name of the function, purpose of <br \/>the function, meaning of each parameter, description of return value (if any), description <br \/> of side effects (if any, such as modifying external variables) <br \/>#. Variable names and function names should be sufficiently descriptive that a <br \/>knowledgeable reader can easily understand what the variable means and what the <br \/>function does. If this is not possible, comments should be added to make the meaning <br \/>Clear. <br \/>#. Use consistent indentation to emphasize block structure. <br \/>#. Full line comments inside function bodies should conform to the indentation of the code <br \/>where they appear. <br \/>#. Macro definitions (#define) should be used for defining symbolic names for numeric <br \/>constants. For example: #define PI 3.141592 <br \/>#. Use names of moderate length for variables. Most names should be between <br \/>2 and 12 letters long. <br \/>#. Use underscores to make compound names easier to read: <br \/> tot_vol or total_volumn is clearer than totalvolumn<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Write a program to check if an email address read from a file is a UCLA email, an email that contains ucla.edu. The output file should contain all the UCLA email addresses read from the input file. You can assume email addresses in the file are valid email addresses. Example input\/output: Enter input file: emails1.txt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-68028","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-programming"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/68028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=68028"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/68028\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=68028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=68028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=68028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}