16 Graphs and charts (3)
Resources |
Revision Questions |
Information Communication Technology ICT
Login to see all questions
Click on a question to view the answer
1.
You are creating a report on the population of a city. The population data is stored in a text file. The data is formatted as follows:
23456789.12345
123456789.98765
98765432.10123
Describe how you would use a text editor (like Notepad++ or Sublime Text) to format these numbers to display only two decimal places. Include the specific steps and any relevant features of the text editor you would use.
To format the numbers in the text file to display only two decimal places using a text editor like Notepad++ or Sublime Text, I would use the Find and Replace functionality with regular expressions. Here's the process:
- Open the text file in the text editor.
- Open the Find and Replace dialog. In Notepad++, this is accessed by pressing Ctrl+H. In Sublime Text, it's found under Edit -> Find -> Replace.
- Enable Regular Expressions. In Notepad++, check the "Regular expression" checkbox. In Sublime Text, click the
.*
icon in the Find and Replace panel to enable regular expressions. - Enter the following regular expression in the 'Find' field:
([0-9]+\.[0-9]{5,})
This regex will find any number that has at least five digits after the decimal point.
- Enter the following replacement string in the 'Replace with' field:
$\2.2
This will keep the number before the decimal point and replace the digits after the decimal point with two decimal places.
- Click 'Replace All'. This will replace all occurrences of the pattern with the formatted numbers.
- Save the modified text file.
This method uses regular expressions to identify numbers with more than two decimal places and then replaces the excess digits with periods to ensure that only two decimal places are displayed. The regular expression ensures that only numbers with at least five digits after the decimal point are affected, preventing unintended modifications to numbers with fewer decimal places.
2.
You are creating a line graph to show the temperature changes over a 24-hour period. The graph currently uses a single solid colour for the line. Describe two different ways you could enhance the appearance of the line graph, including details about the colour scheme or fill patterns you would use. Explain why each enhancement would be beneficial to the clarity and understanding of the graph.
- Use a Colour Gradient: Apply a colour gradient to the line, transitioning from a cooler colour (e.g., blue or green) to a warmer colour (e.g., orange or red). This can visually represent the temperature change over time, making it easier to understand whether the temperature is rising or falling. A gradual colour change provides a clear visual cue.
- Add a Fill Pattern to the Line: Instead of a solid line, use a subtle fill pattern (e.g., dashed line, dotted line) to give the line more visual weight and make it easier to follow, especially if there are multiple lines on the graph. This can improve readability, particularly if the line is overlaid on a busy background.
3.
A researcher is comparing the average test scores of three different teaching methods – Method A, Method B, and Method C. The results are:
Method | Average Score |
Method A | 75 |
Method B | 82 |
Method C | 79 |
Which graph type would be most appropriate to compare these average scores? Justify your answer.
A bar chart (or column chart) would be the most appropriate graph type.
Reasoning: Bar charts are excellent for comparing discrete categories. In this case, the teaching methods (Method A, B, and C) are distinct categories, and the average test scores are numerical values that can be easily compared using the height of the bars. The height of each bar directly corresponds to the average score, making it easy to visually determine which method has the highest or lowest average score. It's a clear and straightforward way to present comparative data.