Exam 1 Study Guide (Written Exam) --------------------------------- - The written exam will be open-book, open-notes. (This means access to the zyBook and class websites are permitted. Access to your own written or printed notes are permitted. Going offsite to websites like StackOverflow are not permitted.) - The computers in SAB 102 do not have IDLE or Python installed. You will not be able to actively type in Python code. - The exam will be TIMED TO 45 MINUTES during the Wednesday class period. In the past, most people finish in a half hour. - If you cannot attend in person, please send me an email. - Don't forget the first week and a half of class before we started programming! - Review the vocabulary in the slides concerning how a computer works - The parts of a computer - Storage units of measure (bits, bytes, kilobytes, megabytes, gigabytes) - How to convert from one unit of measure to another - Look through the class slides and zyBooks to be sure you know the vocabulary words. - Understand how to prompt the user for input using input(). - Understand how to display results using print(). - Understand the string, float, and int data types and how to convert from one type to another type. - How to use if, elif, and else. - How to reverse a Boolean statement with DeMorgan's Laws - How to use for loops and while loops. - Know how the range() function works with a loop. For example, what does this do: for number in range(3,10,2): print(number) - Be able to explain the difference in words between a for loop and a while loop. When would you use one over the other? - Know how string indexing works. For example, what will my_string[0] give me? - Know how string slicing works. For example, what will my_string[0:5] give me? What about my_string[:9] or my_string[1:]? - Know how to use the + with two strings and the * with strings. For example "hello" + "there", or "hello"*3. - Understand how to use a loop to go through a string, one character at a time. For example: for char in my_string: print(char) - Be aware of the string methods we went over in class. For example, how does my_string.lower() work? How does my_string.find('a') work? - To practice reading code, go through your lab submission code on the autolab and see if you can explain what each line of code is doing. - If you need more practice, you are allowed to use AI to help you study by generating code that you must explain. (Warning: the code may or may not be correct, so you will want to run the code after generating it.) You can use and modify the following prompt for studying: I want to test my ability to understand what python programs are doing at the CS1 level. Please generate some code using without explaining it and without code comments. Exclude the following concepts: defining our own functions, lists, tuples, and dictionaries. Replace with some programming concept you are having trouble with, like branching, string slicing, string indexing, for loops, while loops, sentinel-controlled loops, or nested loops. To test if you are right, you can copy the code into IDLE and run it. Exam 1 Study Guide (Programming Exam) ------------------------------------- - The programming exam will be closed book, closed notes during your lab time with the exception of a printout of side 1 of the two-page reference help sheet. - Practice coding without any help (except for side 1 of the two-page reference help sheet) in IDLE from the exam 1 test bank. Do this to determine what you need to practice. You want to spend no more than 15 minutes per problem on average. - This exam WILL NOT be autograded. I will hand-grade all your submissions. I will also give partial points for trying something, and the closer you get to the actual solution, the more points you will earn. - This also means that you must test your programs yourself and make sure they work. (The autograder will not be there to test your programs.) - Use the test bank of problems to study. - If you encounter a program that is hard on the exam, skip it to do the ones you know you can do. Come back to the hard one when you have time at the end.