Handling Errors, Cheating, Competency Exams, Chars, Loops

Channel:
Subscribers:
2,640
Published on ● Video Link: https://www.youtube.com/watch?v=9pEj7OCX8p4



Duration: 1:06:36
194 views
1


Today we started by going over the first homework assignment, and looked at some common mistakes students made when writing it, especially with handling errors. It's really important for your code to handle anything that the user might throw at it.


Second, we went over the next homework assignment, you will be writing code to figure out what kind of triangle the user types in. (At about 24 minutes in I made a mistake and said it would default to saying a triangle was EQUILATERAL when it actually defaults to OTHER, but the point remains the same - if you just remove the return 0 from main you'll get at least a couple points even if you do nothing else.) All your code will be in an area called triangle_tester, and will categorize the input (which is three floats) into determining if the triangles are RIGHT, EQUILATERAL, ISOCELES, and so forth. It's basically what we did in lab, except the inputs aren't sorted by size.


We also talked about the importance of doing the daily quizzes since they count as your attendance. If you miss enough classes, you'll be dropped, so do them every day even if you don't get a good grade on them.


We talked a bit about cheating, specifically using web sites like Chegg, and what web sites you should use instead (Stack Overflow, learncpp.com, cppreference.com, etc.) Don't copy more than maybe one line of code.


We then talked about your first competency exam, which is sort of like a mini-midterm that you get to retake if you botch it. They're designed to be hard. While they're open book tests (except for copying from Chegg or other people), you should prep BEFORE taking the test rather than trying to look up things during the test. If you botch a test, you can take version 2 of the test the next week. If you fail that, you have to go to the Tutorial Center for help to unlock take 3 and take 4. Your grade is the best of the four tests, and a 3/4 rounds up to a 4/4.


We briefly talked about the char type, which holds a single letter. Strings are basically a bunch of chars. You use single quotes for chars and double quotes for strings, as such:


char ch = 'T';
string s = "T";


These are very much not the same, though they both just hold a T!


Finally, we did a conceptual introduction to loops. We'll go over the syntax on Friday.







Tags:
csci 40
error handling
cheating
competency exams
chars
loops
triangle testing