Cie AS Computing
Dear all,
Welcome to AS computing class. I am Dr.Ravi your facilitator for this course. This course consists of two modules, theory and practicals. In theory we will have 12 chapters and in practicals we do have programming classes. You will sit for theory and practical exams at the end of the course, which is conducted by CIE.
All the best, keep moving, for there is always a helping hand above you to guide you.
Dr.Ravi
Tags:
Class Assignment
Question: Write a programming segment to accept 10 numbers in a single dimensional array and store them in a text file.
Answer:
Using Visual Basic 6.0
Private Sub Command1_Click()
Dim a(10) As String
For i = 1 To 5
a(i) = InputBox("Enter a Number")
Next i
Open "c:\computing" For Output As #1
i = 1
While i < 11
Write #1, a(i)
i = i + 1
Wend
Close
End Sub
Dain Razali
7037
Block 4-AS Computing
Muhammad Mujahid / 7096
Block 4 AS-computing / July 2011
5 March 2012
Class Assignment
Question : A program contains a text file containing the following fields:
- student ID
- student Name
- student Course
Write a program statement to read the data from the file and store it into 3 different single dimension array
Raj Kumaran Kalidas
7137
Block 4 AS-computing / July 2011
5 March 2012
Class Assignment
Question : A program contains a text file containing the following fields:
- student ID
- student Name
- student Course
Write a program statement to read the data from the file and store it into 3 different single dimension array
Open "c:\studentsdata.txt" For Output As #1
f = 1
While f < 4
a = InputBox("enter students id")
b = InputBox("enter students name")
c = InputBox("enter students course")
Write #1, a, b, c
f = f + 1
Wend
Close
Dim x(3), y(3), z(3) As String
Open "c:\studentsdata.txt" For Input As #1
While Not EOF(1)
Input #1, a, b, c
i = i + 1
x(i) = a
y(i) = b
z(i) = c
Form1.Print x(i), y(i), z(i)
Wend
my excel task
excel task
sorting 10 numbers in descending order
Algorithm
83 65 m 80 76 69
AS computing class test for 13th March Block 4 Students.
A company has a workforce of around 2000. Some work in the office using the computer system for administrative tasks, while others use the computer system on the production line for giving details of orders that need to be manufactured.
1. Describe the factors that would have been important in the design of the software interfaces to be used by the office workers and the shop floor workers. (6)
2. Select appropriate peripheral hardware for these two application areas, giving reasons for your choices. (12)
.
3. The office workers often have to key in the details of new members of the workforce. The details of the worker are on a standard form which the new employee fills in. Explain how a form based software interface would be useful to the worker who has to key in the data. (4)
4. Explain the types of output that would be expected from the computer on the factory production line, if it is used to control the speed of the production line as well as being used as a tool for the workers. (4)
5. Explain why speed mismatch would mean that the computer should be in control of the speed of the production line. (3)
1 A stock file in a warehouse has the following fields in each record.
• Name of item.
• Date of last delivery.
• Price of item.
• Whether or not an order is outstanding.
• Number of that item left in stock.
(i) State data types suitable for each of the fields. [5]
(ii) Given that there are approximately 10000 different items in the warehouse, estimate the size of the stock file. You should clearly show all the stages in the calculation. [5]
Answer: Q4 MJ 04 (b)
2 An algorithm has been produced which inputs two numerical values and outputs the larger one. Select three pairs of numbers that could be used as test data. Explain what each pair of numbers is intended to test. [6]
Answer: Q3 MJ 02
3 The algorithms shown have both been written with the intention of printing out the even numbers from 2 to 10 inclusive.
A |
X = 2 |
B |
X = 2 |
|
WHILE X < > 10 DO X = X + 2 OUTPUT X ENDWHILE END |
|
REPEAT X = X + 2 OUTPUT X UNTIL X > 10 END
|
(a) State the outputs from
(i) Algorithm A,
(ii) Algorithm B. [2]
(b) Modify
(i) Algorithm A
(ii) Algorithm B
so that each will output the even numbers from 2 to 10 inclusive. [6]
Answer: Q3 on 02
A: x = 0 B: x = 0
Until x >= 10
Full implementation:
A |
X = 0 |
B |
X = 0 |
|
WHILE X < > 10 DO X = X + 2 OUTPUT X ENDWHILE END |
|
REPEAT X = X + 2 OUTPUT X UNTIL X >= 10 END
|
4 TOTAL = 10
REPEAT
READ K
IF K >= 2 THEN
TOTAL = TOTAL + K
ELSE
K= K* K
TOTAL = TOTAL + K
ENDIF
PRINT TOTAL
UNTIL K= 2
PRINT TOTAL
END
Write down the output produced by this code with the following input string
3, 5, 1, 2, 4, 0 [5]
Answer: Q3 ON 03
5 (a) INPUT A, B
IF B = 0 THEN C = A
ELSE C = A ÷ B
ENDIF
PRINT A, B
PRINT C
END
Write down the outputs produced by the algorithm if
(i) A = 8, B = 2 [4]
(ii) A = 6, B = 0 [4]
(b) An automatic fan is designed so that it turns on only when a person is in the room AND the temperature is above a set value (D).
The fan receives information from two sensors.
1. A motion sensor which returns a value (M) dependent upon a person being sensed in the room.
2. A thermistor (electronic thermometer) which returns the temperature in the room (T).
Produce an algorithm to control the fan.
Your algorithm may be expressed in any form. [8]
Answer: Q3 ON 06
6 D=1
INPUT X, E
B=E
C=E
FOR I = 1 TO (X-1)
INPUT A
IF A>B THEN B = A
ELSE IF A < C THEN C = A
END IF
END IF
D = D + 1
E = E + A
NEXT
F = E/D
OUTPUT B, C, F
END
(a) State the output values of B, C and F for the following input test data
4, 6, 3, 7, 0 [3]
(b) Give three other different sets of test data, explaining what condition each is meant to test. [6]
Answer: Q6 MJ 07
7 A town election is held to elect a new mayor.
The people in the town can vote for whoever they prefer from the three candidates A, B, C.
The voting is done by each voter pressing one of a set of buttons labelled A, B and C in the voting booth. This acts as input to a computer program. An early version of the software assumes that there are 1000 people who will be voting. It uses an array, VOTES() to store the votes that are cast. VOTES() is an array of 1000 characters, A, B or C.
A second array, CANDIDATE_TOTALS(), contains three integers and is used with the array, VOTES() in the following algorithm:
01 FOR i = 1 TO 1000
02 IF VOTES(i) = “A” THEN
03 CANDIDATE_TOTALS (1) = CANDIDATE_TOTALS (1) + 1
04 ELSE
05 IF VOTES(i) = “B” THEN
06 CANDIDATE_TOTALS (2) = CANDIDATE_TOTALS (2) + 1
07 ELSE
08 CANDIDATE_TOTALS (3) = CANDIDATE_TOTALS (3) + 1
09 ENDIF
10 ENDIF
11 NEXT i
12 OUTPUT A,B,C
(a) (i) Explain why it will be necessary to initialise the array CANDIDATE_TOTALS () before the algorithm is run. [2]
(ii) Write a FOR loop which can be used to initialise the array CANDIDATE_TOTALS() at the start of the algorithm. [2]
(iii) Explain what happens when the program based on this algorithm is executed.
[4]
(iv) By stating the type of operator in each case, explain why the use of the ‘=’ signs in lines 2 and 3 are different. [3]
(v) Line 12 is meant to output the total votes for A, B and C. It does not work.
Rewrite line 12 to produce the correct result. [2]
Answer: Q3 (a) Specimen Question
(b) The following algorithm is written to determine which of A, B and C gets the highest vote.
01 IF CANDIDATE_TOTALS (1) > CANDIDATE_TOTALS (2) THEN
02 IF CANDIDATE_TOTALS (1) > CANDIDATE_TOTALS (3) THEN
03 OUTPUT “A”
04 ELSE
05 OUTPUT “C”
06 ENDIF
07 ELSE
08 IF CANDIDATE_TOTALS (2) > CANDIDATE_TOTALS (3)THEN
09 OUTPUT “B”
10 ELSE
11 OUTPUT “C”
12 ENDIF
13 ENDIF
(i) Some people do not vote and the result of a particular vote is that all of A, B and C receive equal votes.
State the line numbers that will be executed by the algorithm and which of A, B or C will be output. [4]
(ii) Explain how the algorithm would need to be altered to deal correctly with two or three of the candidates receiving equal votes. Do not produce the algorithm. [4]
Answer: Q3 (b) Specimen Question
Paper 2
75 marks
2 hour s
1 (a) Explain the differences between RAM and ROM, stating a use for each. [4]
(b) A shopkeeper uses a stand-alone computer for producing
• order forms for sending to suppliers
• records of sales and purchases as evidence for the taxation authorities
• leaflets advertising special offers.
(i) State software appropriate for doing each of these tasks. [3]
(ii) The computer has a hard drive, a CD-RW drive and a DVD drive.
State a different use, by the shopkeeper, for each of these three storage media. In each case say why it is appropriate for that use. [6]
Answer: Q1 MJ 06
2 Describe the following types of human computer interface and for each one give an example of an application for which it would be used.
(i) Graphical User Interface (GUI) [3]
(ii) Form-based interface. [3]
Answer: Q2 MJ 06
(iii) Menu-based interface. [3]
Answer: Q5 MJ 02 (Menu-based interface)
3 Communications across a network can be done by using circuit switching or packet switching.
(a) Explain the difference between circuit switching and packet switching. [2]
(b) Give one advantage of using
(i) circuit switching
(ii) packet switching
when sending data across a network. [2]
Answer: Q8 MJ 02
4. The offices of a government department deal with local taxes in a city.
It is decided to develop a new set of software for dealing with the calculation of tax bills. A systems analyst is employed to develop the software.
(a) Explain why care must be taken in defining the problem to be solved. [2]
(b) State two methods that the systems analyst can use to find out more information about the problem, giving an advantage of each. [4]
(c) Explain the importance of evaluating the system against the original specifications. [4]
Answer: Q7 ON 09
5. A small business has one shop. It specialises in taking portrait photographs for customers.
Details of customers are stored on paper.
It is decided to buy a stand-alone computer and use it to store customer records in a file.
Data that is entered into the file needs to be verified and validated.
(a) Explain what is meant by the terms
(i) verification; [2]
(ii) validation. [2]
(b) Describe two methods that can be used for validating the date of the original commission. [4]
Answer: Q8 MJ 06
6 (a) Describe the purpose of the
(i) control unit
(ii) memory unit
(iii) arithmetic logic unit
in a computer. [6]
(b) Explain the difference between main memory and secondary storage. [2]
Answer: Q6 MJ 03
7 (a) Copy and complete this table for an OR gate.
[2]
(b) (i) Copy and complete this table for the circuit.
[4]
(ii) Give a possible use for this circuit in a processor, explaining your answer. [2]
1 (a) Explain the differences between RAM and ROM, stating a use for each. [4]
(b) A shopkeeper uses a stand-alone computer for producing
• order forms for sending to suppliers
• records of sales and purchases as evidence for the taxation authorities
• leaflets advertising special offers.
(i) State software appropriate for doing each of these tasks. [3]
(ii) The computer has a hard drive, a CD-RW drive and a DVD drive.
State a different use, by the shopkeeper, for each of these three storage media. In each case say why it is appropriate for that use. [6]
Answer: Q1 MJ 06
2 Describe the following types of human computer interface and for each one give an example of an application for which it would be used.
(i) Graphical User Interface (GUI) [3]
(ii) Form-based interface. [3]
Answer: Q2 MJ 06
(iii) Menu-based interface. [3]
Answer: Q5 MJ 02 (Menu-based interface)
3 Communications across a network can be done by using circuit switching or packet switching.
(a) Explain the difference between circuit switching and packet switching. [2]
(b) Give one advantage of using
(i) circuit switching
(ii) packet switching
when sending data across a network. [2]
Answer: Q8 MJ 02
4. The offices of a government department deal with local taxes in a city.
It is decided to develop a new set of software for dealing with the calculation of tax bills. A systems analyst is employed to develop the software.
(a) Explain why care must be taken in defining the problem to be solved. [2]
(b) State two methods that the systems analyst can use to find out more information about the problem, giving an advantage of each. [4]
(c) Explain the importance of evaluating the system against the original specifications. [4]
Answer: Q7 ON 09
5. A small business has one shop. It specialises in taking portrait photographs for customers.
Details of customers are stored on paper.
It is decided to buy a stand-alone computer and use it to store customer records in a file.
Data that is entered into the file needs to be verified and validated.
(a) Explain what is meant by the terms
(i) verification; [2]
(ii) validation. [2]
(b) Describe two methods that can be used for validating the date of the original commission. [4]
Answer: Q8 MJ 06
6 (a) Describe the purpose of the
(i) control unit
(ii) memory unit
(iii) arithmetic logic unit
in a computer. [6]
(b) Explain the difference between main memory and secondary storage. [2]
Answer: Q6 MJ 03
7 (a) Copy and complete this table for an OR gate.
[2]
(b) (i) Copy and complete this table for the circuit.
[4]
(ii) Give a possible use for this circuit in a processor, explaining your answer. [2]
The remaining questions refer to the following information.
A mail order company employs telephone operators to take orders by phone and to answer queries from customers about their accounts. Customer details and their orders are stored in the CUSTOMER file. This file can be accessed by the warehouse staff in order to supply the goods which have been ordered.
8 (a) Explain why indexed sequential access to the data in the CUSTOMER file would be appropriate. [4]
(b) Each customer has a unique 7 digit account number which is issued as the key field.
Describe, with the aid of a diagram, an indexing system which could be used to allow indexed sequential access to the CUSTOMER file. [5]
Answer: Q6 MJ 10
9 Backup files and archive files are taken from the CUSTOMER file.
Explain the difference between backing up a file and archiving a file, making reference to the requirements of this application. [6]
Answer: Q7 MJ 10
Paper 1
75 marks
1 hour 30 mins.
© 2025 Created by Ravichandran.
Powered by