1 / 18

Programming revision

Programming revision. Revision tip: Focus on the things you find difficult first. “Every lesson counts – don’t waste a minute.”. Flowcharts. Exam tip: If you are asked to draw a flowchart try use the correct Symbols, but it is the logic that will be tested.

dom
Download Presentation

Programming revision

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. Programming revision Revision tip: Focus on the things you find difficult first.

  2. “Every lesson counts – don’t waste a minute.”

  3. Flowcharts. Exam tip: If you are asked to draw a flowchart try use the correct Symbols, but it is the logic that will be tested. 1. Draw a flowchart to describe the following process: Input 5 values Output their average (4 marks) 2. Draw a flowchart to describe the following process: Input radius for a circle. Check it is positive. Reject and ask for input if not positive. Output the circumference of the circle if positive. (4 marks)

  4. Pseudocode. Exam tip: Always use indents to show loops and conditions when writing pseudocode. • Write a pseudocode algorithm to describe how to get the information and output the area of a triangle. • (3 marks) • Write the pseudocode to describe how to calculate the average of 10 numbers. • (6 marks) Exam tip: You should be able to state the advantages / disadvnatges when asked to compare translators. Programming languages. • Compare an interpreter and a compiler for use by a student learning to program. • (4 marks) • ……………………………………………………... • ...…………………………………………………... • ……………………………………………………… • ...…………………………………………………… • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • What are the main advantages of a high-level langauge over a low-level langauge? • (4 marks) • ……………………………………………………... • ...…………………………………………………... • ……………………………………………………… • ...…………………………………………………… • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • What are the advantages of compiling code for commercial distribution? • (4 marks) • ……………………………………………………... • ...…………………………………………………... • ……………………………………………………… • ...…………………………………………………… • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • ............................................................................. • .............................................................................

  5. Integrated Development Environment (IDE) Exam tip: You should be able to identify the features of an IDE and explain how the features help a developer create a program more effectively. • What are the main features of an IDE? • (4 marks) • ……………………………………………………............................................. • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • How do the features of an IDE help to create maintainable code? • (4 marks) • ……………………………………………………............................................. • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... • ...................................................................................................................... Control flow in imperative languages. Exam tip: You should be able to identify the three different types of control flow (sequence, selection, iteration) from a piece of Code. • Write the pseudocode using a Repeat-until loop to output the first five square numbers. • (2 marks) • Identify which control flow the following programs will use: • (3 marks) • (a) Deciding whether to give a discount to a • customer for having a loyalty card. • ……………………………………………………... • ...…………………………………………………... • (b) Inputting 10 numbers to be totalled. • ……………………………………………………... • ...…………………………………………………... • (c) Setting up the computer when it is switched • on. • ……………………………………………………... • ...…………………………………………………... • Repeat question 2 but this time use a While-Endwhile loop. • (3 marks)

  6. Data types. Exam tip: You will be expected to identify the most suitable data type for a variable. Remember telephone numbers and other numbers used purely for identification should be stored as strings. • An online retailer keeps data about stock in their database. Items of stock are identified by a single letter, F for furniture, G for garden, P for pet, followed by a four digit number. They also store the quantity in stock, the retail price and whether there are more on order or not. • Complete the information in this table. • (3 marks) Exam tip: Learn the definitions for the data types and for variables and for constants. Variables & constants. 2. Describe the difference between a variable and a constant. (2 marks) ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 3. What is a variable? (2 marks) ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 4. What data type will be used for RetailPrice and why? (2 marks) ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ • Constant VAT = 0.2 • INPUT WholesalePrice • RetailPrice = WholesalePrice + WholesalePrice * VAT • OUTPUT RetailPrice • In the code above: • (a) Identify a constant. • ……………………………………………………... • ...…………………………………………………... (1 mark) • (b) Identify the variables. • ……………………………………………………... • ...…………………………………………………... (1 mark)

  7. Operations. Exam tip: Note if num1 ad num2 are integers, +, -, *, MOD and DIV will return integer values but / may not and the result could be a real number (float). What value is stored in the variable result if: (6 marks) (a) Result = 7/2 ……………… (b) Result = 27 MOD 4 ……………… (c) Result = 36 MOD 6 ……………… (d) Result = 23 DIV 4 ……………… (e) Result = 36 DIV 6 ……………… Operator priority. Comparison operators. What value is stored in the variable result if: (6 marks) (a) Value = 17-3*4 ……………… (b) Value = (17-3)*4 ……………… (c) Value = 7*8/2 ……………… (d) Value = 7+8/4 ……………… (e) Value = 17 MOD 3 + 4 ……………… (f) Value = 17 MOD (3+4) ...................... What value is stored in the variable result if: (6 marks) (a) num1 > num2 if num1 = 7 and num2 = 5 ……………… (b) num1 <= num2 if num1 = 7 and num2 = 5 ……………… (c) num1 < > num2 if num1 = 7 and num2 = 5 ……………… (d) num1 < > num2 AND num 1 < num2 if num1 = 7 and num2 = 5 .............. (e) num1 < > num2 OR num1 = num2 if num1 = 7 and num2 = 5 ................

  8. Testing. Exam tip: You will be expected to identify the most suitable data type for a variable. Remember telephone numbers and other numbers used purely for identification should be stored as strings. 1. What is meant by a syntax error? Give an example. (2 marks) ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 2. What is meant by a run-time errorr? Give an example. (2 marks) ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 3. A = 3 B = 5 A + B = C The above code contains an error. What is the error and what type of error is it? (2 marks) ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 4. INPUT customer INPUT cash IF customer = ‘yes’ AND cash > 50 THEN rate = 11 ELSE IF customer = ‘no’ AND cash < 50 THEN rate = 9 ELSE rate = 10 ENDIF ENDIF OUTPUT cash * rate For the algorithm opposite state what the output will be for the following input values: (a) Customer = no, cash = 20 ....................... (1 mark) (b) Customer = yes, cash = 100 ....................... (1 mark) (c) Customer = yes, cash = 20 ....................... (1 mark) (d) Customer = no, cash = 60 ....................... (1 mark)

  9. Past paper exam questions. 2011 past paper.

  10. Past paper answers. 2011 past paper. Notes: What do I need to improve?

  11. Past paper exam questions. 2012 past paper.

  12. Past paper exam questions. 2012 past paper.

  13. Past paper answers. 2012 past paper. Notes: What do I need to improve?

  14. Past paper answers. 2012 past paper. Notes: What do I need to improve?

  15. Past paper exam questions. 2013 past paper.

  16. Past paper exam questions. 2013 past paper.

  17. Past paper answers. 2013 past paper. Notes: What do I need to improve?

  18. Past paper answers. 2013 past paper. Notes: What do I need to improve?

More Related