Handling Errors, Cheating, Competency Exams, Chars, Loops
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.
Other Videos By Bill Kerney
2021-09-01 | Truth Part 1 |
2021-09-01 | Landscapes Part I |
2021-09-01 | Project Updates |
2021-08-31 | Hash Tables + Counting |
2021-08-30 | Coding with Loops |
2021-08-30 | How to Make an Argument and Counterargument - Piracy: For and Against |
2021-08-27 | For and While Loops |
2021-08-27 | Examining Sources |
2021-08-27 | Gaming Psychology and Lerping Materials |
2021-08-27 | Hash Tables |
2021-08-25 | Handling Errors, Cheating, Competency Exams, Chars, Loops |
2021-08-25 | Evaluating Claims |
2021-08-25 | Final Project!!?! |
2021-08-24 | UE4 Material Instances |
2021-08-24 | RSA Encryption Part 2, Computer Security |
2021-08-23 | UNIX Shortcuts, C++ Shortcuts, Bools |
2021-08-23 | Welcome to CSCI 1 @ Fresno State! |
2021-08-20 | Conditionals Part III |
2021-08-20 | Navmesh, Materials, Axis-Aligned Bounding Boxes |
2021-08-19 | Multiplayer Balance and UE4 Materials Pt. 2 |
2021-08-19 | The Optimizer, Bigints, Prime Generation, RSA Encryption, Cryptographic Hashing |