Government Review Worksheet
| # | Answer |
|---|---|
| 1 | A variable is a named place to store data that can change. A government records system might use variables to store things like citizen age, tax amount, or department name. |
| 2 | a) Integer b) String c) Float/Decimal d) Boolean |
| 3 | An integer is better because the number of libraries is a numeric value used for counting and calculations. |
| 4 | IF age >= 18 THEN eligible = true ELSE eligible = false ENDIF |
| 5 | A selection structure such as if-else if-else or switch/case would be useful because it can choose one of several outcomes based on the status. |
| 6 | 3000 |
| 7 | A loop would be useful for processing every resident record in a census list or calculating taxes for all properties in a district. |
| 8 | FOR i = 1 TO 5 DISPLAY i NEXT i |
| 9 | An array or list is more useful because it organizes many related values together, makes the program easier to manage, and allows loops to process the data efficiently. |
| 10 | A function can reuse the same validation rules every time, reduce repeated code, and make the program easier to test and update. |
| 11 | FUNCTION calculateTax(propertyValue, taxRate) RETURN propertyValue * taxRate ENDFUNCTION |
| 12 | resident AND hasPaidTaxes |
| 13 | An algorithm is the step-by-step plan for solving a problem, such as deciding whether a permit should be approved. A program is the coded version of that algorithm that runs on a computer. |
| 14 | Two good practices are using strong passwords and encrypting sensitive data. Other acceptable answers include access controls, authentication, and regular updates. |
| 15 | approvedCount = 0 FOR i = 1 TO 100 IF applicationStatus = 'approved' THEN approvedCount = approvedCount + 1 ENDIF NEXT i DISPLAY approvedCount |