1 / 13

Introduction to Computers and Programming Midterm Review Sana Odeh

Introduction to Computers and Programming Midterm Review Sana Odeh. midterm. Thursday 3/6 at 2pm during class It is a closed book exam You will have the entire class period to complete the exam 5 short answer (total of 15 points) 1 what does this do (20 points)

aram
Télécharger la présentation

Introduction to Computers and Programming Midterm Review Sana Odeh

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Computers and ProgrammingMidterm ReviewSana Odeh

  2. midterm • Thursday 3/6 at 2pm during class • It is a closed book exam • You will have the entire class period to complete the exam • 5 short answer (total of 15 points) • 1 what does this do (20 points) • 1 find the errors (15 points) • 2 write a program (total of 50 points)

  3. Midterm material • From the book: • chapters 1 - 4 • Except(nested loops)

  4. How to study for the exam Note: Before you begin ... There is an old joke that is recited as follows: • Question: How do you get to Carnegie Hall? • Answer: Practice, practice, practice! • The same is true here... I can't emphasize enough • Study class notes and textbook readings and examples • reviewing the programs that we wrote and analyzed in class; • writing your own code; practicing programming at the computer; • running programs using the step method and watching how variables change as the program runs ... • these are the primary tools which will help you to study and to prepare for the final exam.

  5. What to focus on? Review list General • programming languages • structured programming • Object oriented programming

  6. What to focus on? Review list syntax • /* comments in code */ • // more comments in code • Import statements; why are they used? what do they do? name one example and why/when you would use it • Blocks and{braces}: what do the braces do? • What is a statement? (Note the ";" at the end.) • Algorithm: what is it ? how is it used? • What is the difference between (parentheses), {braces}?Which ones do you use and when?

  7. What to focus on? Review list Variables • variables • data types: what are they? name at least 5. Which ones are used when? • declarations • initialization • assignment = vs = = What is the difference? • operators: name at least 11; name at least one example and define unary operators, binary operators, and ternary operators • reserved words: what are they? name at least 5

  8. What to focus on? Review list • integer division: what is it and how is it used? • operator precedence: what is it? how does it work? • more operators: ++, --, +=, *=, etc. How are these used? Errors • We have seen examples of run-time errors, logic errors and compilation or syntax errors. Which are which? How do you fix them? How do you find them?

  9. What to focus on? Review list Control Structures • Sequence structure: what is it? How do you describe this in Java? • Selection structure: what is it? How is it used in Java? • Repetition structure (aka "iterative structure"): what is it? Give examples in Java • Boolean values: How can they be used in iterative structures? • Nested statements: what are these? what does this imply? give examples • if vs else if: which is which?

  10. What to focus on? Review list • logical operators: list at least five. How are they used? What are the results? • switch: what is it and how is it used? • while loops: what are they and how are they used?What are the three required components for all while loops? Give examples. • What is an infinite loop? Give an example. • Define counter-controlled repetition and give an example. • Define sentinel-controlled repetition and give an example.

  11. What to focus on? Review list • What is a for loop? How is it used? give an example. What are the three components of a for loop? • What are the advantages and disadvantages of for loops vs while?

  12. Review For Loops • What is the output of this loop? int rows, columns; { for (columns=1; columns<=10; columns++) System.out.print ("*"); System.out.println (); }

  13. Summary of control structure in programming languages • Sequence • Statement follow one another • Selection Structures • if • if/else • if/else if/else • switch • Repetition Structures • while • for

More Related