The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Im having a hard time doing both parts of the assignment a & b. According to the marking guide, part a has to use a for loop and part b has to use a while loop. I have attached both the question and marking guide. Thanks a ton!
CIS*1500 – Assignment 3Due: Sunday Mar 6 – 11:59pm EXTENDEDWrite complete C programs for each problem and submit them separately in the dropboxesfor Assignment 3A and Assignment 3B respectively.Make sure you submit the .c file,not the executable.Your programs must compile successfully with the command:gcc -Wall -std=c99 yourfile.c -lm(A)[20 marks]Given an input filegrades.txtcontaining the terms grades for CIS 1500,calculate the class average for each assignment, midterm and final in terms of a percent (i.e.,77%)roundedto the nearest percentage point.The first line of the input file has a single integer specifying the number of studentsNinthe class. The second line contains what each item (there are 7 of them) is out of, and thefinalNlines are the rawintegerscores for each student as follows:ass1mark ass2mark ass3mark ass4mark ass5mark midterm finalIf each assignment is out of 90, the midterm is out of 50, and the final is out of 100, an inputfile with 3 students may look like:390 90 90 90 90 50 10081 80 70 75 77 44 7750 40 60 44 55 33 2290 88 70 90 44 50 11You may assume that the input file is correctly formatted (you do not need to test for validityof the data). The output to this C program must be written to the fileaverages.txtwhichfor the above input would look like:There are 3 students in this class.The average for assignment #1 is 82%.The average for assignment #2 is 77%.The average for assignment #3 is 74%.The average for assignment #4 is 77%.The average for assignment #5 is 65%.The average for the midterm is 85%.The average for the final is 37%.1
CIS*1500 – Marking Key for Assignment 3Name:Student #:Part ACriteriaMarkTestingPasses test case I/ 4Passes test case II/ 4StyleAppropriate header/ 1Meaningful and descriptive comments/ 1Appropriate and consistent use of whitespace/ 1Appropriate identifiers/ 1Readable and consistent indenting/brackets/ 1Code QualityAppropriate use offor loop/ 2Appropriate variable initialization/ 2Closing of open files/ 1GeneralCompiles with no warning messages/ 2Total:/ 20Part BCriteriaMarkTestingPasses test case I/ 4Passes test case II/ 4StyleAppropriate header/ 1Meaningful and descriptive comments/ 1Appropriate and consistent use of whitespace/ 1Appropriate identifiers/ 1Readable and consistent indenting/brackets/ 1Code QualityAppropriate use ofwhile loop/ 2Appropriate variable initialization/ 2Closing of open files/ 1GeneralCompiles with no warning messages/ 2Total:/ 20
Attachments:
-----------