exam1_topics.pdf
Document Details
Uploaded by Deleted User
University of Texas at Arlington
2024
Tags
Full Transcript
CSE 1320: Introduction to Computers & Programming University of Texas at Arlington Fall 2024 Alex Dillho Exam 1 Review Topics 1. ASCII Understand the relationship between uppercase and lowercase characters. 2. Base Conversions Understand conversio...
CSE 1320: Introduction to Computers & Programming University of Texas at Arlington Fall 2024 Alex Dillho Exam 1 Review Topics 1. ASCII Understand the relationship between uppercase and lowercase characters. 2. Base Conversions Understand conversion from decimal to binary. Know the general procedure for converting between bases. 3. UNIX cd - Change directory. ls - List current directory contents. mv - Move a le. mkdir - Make a directory. rm - Remove a le. cp - Copy a le. 4. Formatting Standards Statements should be indented to reect their scope. Spacing should be consistent. Bracket and bracing placement should be consistent. 5. Identiers, Keywords & Reserved Words Know common keywords covered in class and assignments. Understand the rules for identier names. 6. Formatting Input & Output Apply eld width with to format specier (%10d). Truncate oating point precision (%.2f). Escape sequences (\t, \", \', \n, \\). 7. Operators Arithmetic Operators CSE 1320: Exam 1 Review Dillho Equality and Relational Operators Compound Assignment Increment and decrement Logical Operators Bitwise Operators 8. Preprocessor Directives #include #define 9. Control Structures if if-else switch while do...while for nested loops break continue return 10. Function Denitions vs. Declarations Be able to write the declaration of a given function. 11. Arrays and Strings Know how to declare and initialize 1D arrays. Know how to declare and initialize 2D arrays. 12. File I/O (a) Outcomes Open a le for reading, writing, appending, and update. Closing a le. Understand that the FILE * object has a pointer to the current position in the le and reading moves that pointer forward. Know how to check if a le was opened correctly. Write your own code to check that a le exists. (b) Problems Open a text le, read the information, and copy the words in reverse order to a new le. 2 CSE 1320: Exam 1 Review Dillho Open a text le, read the information, and write it to a new le in order from lines with the most words to the least. Create a program which checks a CSV le to ensure that there are no issues with the data. For example, if one of the lines is missing a property then it would be agged as invalid. Create a CSV le which stores information about student grades. Open the le in a program and print each line in a neatly formatted table. You can decide which information is appropriate. 13. Structures (a) Outcomes Be able to declare structures and variables to structures. This includes include declarations of variables with the structure declaration. Understand how initialization works with structure variables. Understand what is meant by packing and padding in relation to struc- tures. Understand how structures and their sizes dier from other aggregate types. For example, the size of a struct can always be inferred where as a pointer to an array does not carry that information. (b) Problems Create a function which takes a pointer to struct as an argument. Com- pare the size of the pointer to the dereferenced struct. Create including one for car and manufacturer in which every car has as a member the manufacturer for which it belongs. Create a has a FILE * as a member along with another member to keep track of the total number of bytes read by the le. Implement this in a program which updates this byte count every time a call to fgetc() or fread() is made. 14. Typedefs (a) Outcomes Familiarity with typedef syntax. Create a typedef with aggregate types (including struct). (b) Problems Create a 4D vector using typedef. Create a struct that is dened using typedef. Question Types & Examples Denition & Evaluation These questions will test your knowledge of basic terms and concepts in C. At most they would require a statement or two, in your own words, about the concept being asked. 3 CSE 1320: Exam 1 Review Dillho Examples Given a function declaration, how would you write the equivalent denition? You do not need to write the code inside the function itself. // Declaration int is_odd(int); // Definition int is_odd(int number) { // This can be left empty. } What type of value does the expression below return? int a = 5; (a = 10); //