Starting from:
$35

$29

Homework 01 Solution

Introduction
For many of you, CS 1371 will be your first encounter with programming and, thus, homework assignments involving programming. Even for those of you who have programmed before, this class can be an entirely new experience. So to make life a little easier, we have created this CS1371 Homework Guide to cover the variety of details involved with the homework assignments.

Completing an Assignment

If you have not already, we recommend the creation of a CS 1371 directory folder on your computer to hold each individual homework assignment.

    • Create a folder for the assignment in your CS 1371 directory.

    • For the first assignment, you may download the Homework <##>.zip file from T-Square’s Assignment page for the homework.

    • For the rest of the semester, you must use the custom built function getMostRecentFiles() to download your homework assignments. Further instructions on how to do this are below.

    • Open the hw<##>.m file and fill out the information section at the top of the file, where ## corresponds to the homework number. There is typically one homework assignment a week, with 13-14 assignments total over the semester (this is different for the summer semester).

    • Follow  the  directions  outlined  in  the  hw<##>.m  file:  complete  the  ABCs  file
 


included with the homework, then complete the drill problems described in “Homework ## Drill Problems.pdf”.

    • Test your code. While testing seems like a small task, it can easily make the difference between a zero and a hundred on an assignment. When you test your code, make sure you receive no errors and the output of your code is correct. It is a good idea to use the isequal() MATLAB function in conjunction with the outputs of your own code and included solution files; for information on how to use the isequal() function you may search the MATLAB documentation.

    • Suppress your outputs. While writing code, sometimes it is useful to have MATLAB automatically display the results from running the code. However, when turning in your homework, your function should not display anything to the Command Window. This is called suppressing your outputs. To do this you need to put semi-colons at the end of any lines that may cause something to display to the Command Window. Not suppressing your outputs may result in a loss of points on your Homework Assignment.

    • Once you have completed the entire assignment, always do one final check to make sure everything is working properly before submitting.

Using getMostRecentFiles()

getMostRecentFiles() is a MATLAB function that will download and update your

homework for you. You can run this function whenever updates are released to the homework, or when you want to download the homework for the first time.
Provided below are two links: one to download the function and one to access the documentation for the function, which explains how to use it. Please read it to understand how to use this tool. As mentioned, it will be required to use for most of the semester to access your homework assignments. There is one important snippet to mention here:

While you can run this function in any folder, it is highly recommended that you place this file directly into your “MATLAB” folder (created when you first installed MATLAB). Any files placed in this folder can be run from any directory. In other words, if you place the file in this folder it becomes just like any other built-in function

Function: https://cs1371.gatech.edu/getMostRecentFiles/getMostRecentFiles.p

Documentation: https://cs1371.gatech.edu/getMostRecentFiles/getMostRecentFiles_Help.pdf

Submitting the Assignment

For this class, all homework assignments will be submitted through Canvas. It is extremely important to properly submit each assignment. Failure to do so may result in a significant loss of points.

    • Each assignment comes with a basic hw<##>.m file, such as hw01.m or hw14.m. In those files, there will be a section called Files to Submit near the top of the assignment. Compare the name of each file you are submitting to the names in the Files to Submit section and make sure that they correctly match up. However, if there is a discrepancy between a file’s required name in Files To Submit and the file’s name as described in the Homework ## Drill Problems.pdf file (such as a typo) then submit


2
 


the file as it is named in the Homework ## Drill Problems.pdf file.

Note: Case and spelling do matter.

    • Submit the assignment on Canvas by uploading all required files to the assignment page under File Upload and clicking submit assignment.
Note: Do NOT archive your files into some format such as .zip or .rar

    • Please check to see if your assignment was successfully submitted. After submitting correctly, you will see a check mark next to “Turned in!” in the top right corner.

    • If you wish to be thorough, you may re-download your submitted files and check whether you submitted the correct files. Also, test your submitted files in MATLAB to see that they do run properly.

Resubmitting the Assignment

For most homework assignments in 1371 there is a corresponding optional resubmission assignment, with exceptions including assignments falling over some breaks in the semester and assignments at the end of the semester. The resubmission assignment is due at 8:00 pm the Friday following the original Tuesday due date of a homework assignment, and it has the same grace period until 11:59 pm that the original submission of an assignment has. When you resubmit an assignment, your overall grade on the homework will be the average of the grade you receive on the original homework and the resubmission. If you choose to submit a resubmission, you must submit all required files (i.e. not just the files for specific problems you have rewritten).

During test weeks in 1371 (when help desk is closed for the second half of the week) your grade on the homework that week will become the maximum of the grades on the two submissions. This applies only to a homework that is due the week of the test.

Commenting

Whenever you program, it is always a good idea to comment your code. Commenting helps you keep track of what you are attempting to code and it helps others to understand why you wrote various lines of code. Since there is no partial credit in our homework grading system, we have added a commenting system to give some incentive to at least attempt each problem. From now on, when you write a solution to a problem, you should comment your code and explain what you were attempting to do to solve the problem. Some good places to comment would be sections of your code that directly relate with your algorithm. However, do not comment every line of code. Instead comment the lines of code that are either difficult to understand or are important steps to solving the problem.
Commenting will purely be for extra-credit purposes, so if you don't want to comment your code, you don't have to. Your Section TA will grade the comments from each homework assignment, and he or she will keep track of your commenting points throughout the semester.

Finally, if you come to help desk, you are expected to have your code commented. If a TA sees that your code is not commented, he or she has the right to move on to another student until you comment your code.

Collaboration Policy

On    each    homework    assignment,    you    are    allowed    to    collaborate    with    your    fellow



3
 


classmates. However, collaboration means working together to identify methods for solving problems, not the sharing or copying of code. If you share or copy code, you will have violated Georgia Tech’s Academic Honor Code, and we will prosecute you. Also, when you collaborate, make sure to reference who or what you have collaborated with in the collaboration section of the homework file. Again, Copying or sharing of your code is a violation of Georgia Tech’s Academic Honor Code and a very serious offense. It has a much larger impact on the rest of your life than receiving a 0 on a homework assignment in an entry-level college course.

Issues on a Homework Assignment

Part of the entire TA team for CS 1371 is a Homework Team, which is the team of teaching assistants who plan, write, and compile all the homework files for all homework assignments in this course. This is done in real time during the semester, with each homework assignment being released to the students as the final stage of this job. There is a lot of work that goes into the creation of every homework assignment, and we do not always do a perfect job (especially for homeworks that were made over a big test week on campus, since we are all students, too). So, to correct for any imperfect homeworks, updates and changes may be made to a homework assignment over the week it is assigned. For example, if errors are found in solution codes or problem statements, then new files will be written and updated via getMostRecentFiles(). We will release announcements for major changes in homework assignments; however, for minor changes, an announcement may not always be released. Hence, as a general rule of thumb, it is always a good idea to update your homework files using getMostRecentFiles() before each session that you work on your homework. For some issues there may be grade changes associated with corrections, for others there will not be. This will depend on the severity of an issue with the homework, and will always be explicitly stated when an issue is discovered and fixed.

As a general rule of thumb, the problem statement for each function is the end-all-be-all. So if there are any discrepancies or issues that you find in the homework assignment, and you are not sure how to code a problem, always reference something that is explicitly written in the problem statement for a function. If there are disagreements with explicitly written instructions in the same problem statement, then you may follow either of the written instructions for credit, but please email a TA to make sure the issue has been noted.

If you come across an issue on the homework, and are not sure whether it has already been fixed/updated, then please check Canvas for any announcements or check Piazza for any students who have already asked about the issue and received an answer. If you do not see anything correcting the issue anywhere, then you may email your section TA about it. Do not email the Homework STA directly, unless he/she also happens to be your section TA.




Grades

For each assignment, your overall homework grade is made up of two parts: Homework Coding Grade (95%) and ABCs Grade (5%). If there are any drill problems included that are listed as extra-credit, then they will usually be for an extra 15% to 20%.



4
 


Homework commenting is also for extra credit, and though your section TA assigns a grade for your comments on each homework assignment, there is no explicit rule for how much extra credit this is worth these comment grades are worth. For your purposes, you may think of the level of extra credit given from comments as being “curved”, and it is added to your final grade in the course rather than to individual homework assignments.

Regrade Requests

Since CS 1371 is a class of almost a thousand students, an Autograder is used to grade each homework assignment, and the grading policies must be strict because it would require much more manpower than is available to implement any leniency on such a grand scale. However, the Autograder used is essentially a large MATLAB program that tests your functions to see if the outputs match the correct values for given test cases, and as such it sometimes makes mistakes (especially on more advanced grading functions, like grading output files or plots). This is why we give you the opportunity to request a grade appeal, or regrade, on any homework assignment. However, (again due to the large size of the course) there are very strict guidelines to requesting a regrade, so do not automatically request one just because you are disappointed in your grade. Furthermore, do not assume that just because you submit a regrade request that your grade will improve. The steps to submit a regrade request for a homework assignment are listed below.

Note: Once homework grades have been posted, you have a week to request a grade appeal.
No grade appeals will be taken past that period.

    • Download the files you submitted for the homework in question. It is important that you download the files you submitted on Canvas and not use the files that are currently stored on your computer. The Autograder only checks files submitted, so you are responsible for any differences between the files you submitted on Canvas and the files stored on your computer.
    • Since the Autograder is a MATLAB program, spelling and case do matter in the context of homework assignments. Always check to see whether you followed the naming conventions outlined in the homework. If you realize that you had accidentally misnamed a variable or file, then you may not request a grade appeal for that problem of the assignment. Also, if there is a typo in an output variable that contains any text, then this is not a valid reason for a regrade request. Please make sure any text in your output variables is typo-free before submitting your files.

    • Go to http://cs1371.gatech.edu/gradebook and log in to access the feedback file. This file explains the grade breakdown for each problem.

    • In MATLAB, run the test cases in the feedback file. If there is an error produced or noticeable inaccuracy with your answers compared to the solution outputs (homework solutions are provided in the T-Square resources section for comparison), then no consideration will be given towards grade appeals.
    • Use isequal() to compare the output variables of your function with the output variables of the solution function for the test cases in the feedback file.

    • If you still believe your code is correct and that the grade was a mistake, then you may submit your homework assignment for a regrade. Navigate to http://cs1371.gatech.edu/regrades/ to submit a regrade. Follow the on-screen instructions to submit your request. Once you submit your request, your TAs will


5
 


receive an automated email informing them of your request for a regrade. Do not email your TA directly or email your code. Your TA has access to your original submission, and that is what they will use to check your code. If your TA agrees with you, he or she will approve your regrade request and change your grade on Canvas.

    • If your section TA does not approve or deny your request within a week of the day you sent your e-mail, then forward said e-mail to the Homework Team email: http://cs1371homeworkteam@gmail.com. If you still do not get a reply, then emal the Homework Team STA, Amanda Schmitt, directly at aschmitt8@gatech.edu. The forwarded email message must contain the sent date of the original email.
Note: Not following the procedures listed above may forfeit your right to request a grade appeal for the homework in question.

Functions You Should Never Use

The following MATLAB functions should not be included in your code because they cause the Autograder to break. You can still use these functions while coding, but make sure to either comment the functions out, or remove them completely before submitting the files to Canvas. If these functions are not removed, you will lose a significant amount of points for that part of the assignment.

    • clear

    • clc
    • input

    • error
    • figure
    • disp
    • fclose all


General Questions

    • What is the Grace Period?

The grace period is a three-hour and fifty-nine minute period after the homework due date in which you are still allowed to turn in the assignment for full credit. The original assignment is due at 8:00 pm, and Canvas will accept submissions until 11:59 pm. The grace period exists to deal with issues that may cause you to need some extra time. However, any issues that occur in the grace period are your responsibility. So, if any technical difficulties with Canvas, your computer, or campus internet occur during the grace period, it is still your responsibility to submit the homework on time and there will be no allowances for it. Treat the original due-date with respect, and always attempt to submit before the grace period starts. Remember, we will only accept assignments submitted through Canvas, and not through other sources such as e-mail.


Pseudo-Appendix

    A. How to Download getMostRecentFiles()

    • Function: https://cs1371.gatech.edu/getMostRecentFiles/getMostRecentFiles.p

    • Documentation:


6
 


https://cs1371.gatech.edu/getMostRecentFiles/getMostRecentFiles_Help.pdf

B. How to Submit Assignments on Canvas

    • Go to the CS 1371 Spring 2018 course on Canvas.

    • Choose assignments from the menu on the left.

    • Click on the assignment you wish to submit.

    • On the specific assignment page, choose submit assignment. From here you should choose a file from the file upload tab. In the window, navigate to the folder that contains your homework files and choose the correct file. You will need to upload every drill problem as well as the hw#.m file individually. To upload more than one file, choose “Add another file”. Remember to refer to the Files to Submit portion of the hw#.m file to make sure you have everything.

    • Once all the required files have appeared click “Submit Assignment”

        C. How to Test Code

    • Test Cases – Homework problems will generally have examples on what the outputs should be based on a few given inputs. You should always run those examples to test to see whether your code is outputting the correct values. If your code does indeed output the correct values for that test case, you are usually guaranteed to receive some credit for the problem. However, overall, the Autograder tests with a variety of inputs, so you should also make up your own inputs, and see if the outputs are correct and that there are no errors when running your code.

    • Look in the workspace, not the command window - A common mistake for students to make is to just look at the command window and see if the output displayed on the window is correct. DO NOT DO THIS. Always check the workspace to see if the correct variable has the correct output. Many times people will write code that displays the correct value, but does not actually set a variable. Do not make this mistake, for you will receive no credit for just displaying the correct value on the command window.


        D. How to Submit a Regrade Request

    • Link: http://cs1371.gatech.edu/regrades/

        E. Help Desk

    • Location – Help Desk is located in the Clough Undergraduate Learning Center, commonly abbreviated as the CULC. It is in room 272, which is the very last room on the left side of the back 2nd floor hallway.

    • Format – Help Desk is formatted as such: at the front of the room there will be a table of 3-6 TAs, depending on the time of day. Students may come to help desk, sit at any of the tables, and work on their code for as long as they wish. Then if you come across a question while working, or want something clarified about the homework, you may go to the table of TAs at the front of the room as ask them for help.

    • Hours – Help desk is open from 2pm-8pm Monday – Thursday, and is open from 2pm-5pm on Friday. It is closed on Test Weeks (so that we TAs may grade your tests), and to account for this your homework grade will always be the maximum grade of the two submissions on a test week. It is usually very crowded on Thursday


7
 


and Friday, so we suggest that if you want to really get good help that you come early in the week. NOTE: Summer help desk hours are different than during the regular semester.

    • What Help Desk Is Not – Help desk is not a place where TAs will tell you answers, or where they will trace through hundreds of lines of code to find a single syntax error. We are Teaching Assistants, so we generally try to teach you how to solve the problem yourself. As such, please come to help desk ready to discuss the issues that you are having, rather than putting your computer down in front of a TA and expecting them to fix your problem without any input from you. MATLAB has error messages that will tell you the line of your error and what caused the error, and if you do not understand an error message you may search online to figure out what it means. You do not need a TA to do this for you. Instead, you should come to a TA when you have figured out the error message and have looked for the error yourself but have been unsuccessful. There is usually a line of students waiting for help, in which case we will usually not help you if you haven’t done anything to help us; there are other students who want our help just as much as you.


Good Luck and Welcome to CS 1371!






































More products