Past-paper question · 2015 May-June · Paper 22 · Q5(e)(i)

Question 5(e)(i) 2015 · May-June · Paper 22 · 3 marks

Original past-paper question for 5(E)(I)
Original past-paper question for 5(E)(I)
Original past-paper question for 5(E)(I)
Original past-paper question for 5(E)(I)
Original past-paper question for 5(E)(I)
Original past-paper question for 5(E)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 5(E)(I)Official mark-scheme answer for 5(E)(I)

Official answer for Question 5

Part (e)

(i)

Part (e)

(i)

Sensible Identifier + Data Type + Description (1 + 1 + 1)

✓
For example:
✓
ThisDate
✓
STRING/DATE
✓
date ‘entered by user’
✓
Found
✓
BOOLEAN
✓
flag to indicate ThisDate is ‘present in the
✓
file’
✓
NextLine
✓
STRING
✓
a single line ‘from the text file’
✓
NextDate
✓
STRING/DATE
✓
date ‘from next line in the file’
✓
NextDiscount
✓
STRING
✓
the discount value from NextLine
✓
ThisMonth
✓
INTEGER
✓
the month part of the date (input or from file)
✓
MyStreamReader
✓
STREAMREADER
✓
references DISCOUNT_DATES file
[3]
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International AS/A Level – May/June 2015
✓
9608

Question 22

Mark scheme 9608_s15_ms_22.pdf →

Show text version of question

Question 5

Part (e)

(i)

Question 5

A company creates two new websites, Site X and Site Y, for selling bicycles.

Various programs are to be written to process the sales data.

These programs will use data about daily sales made from Site X (using variable SalesX) and Site Y (using variable SalesY).

Data for the first 28 days is shown below.

SalesDate SalesX SalesY 1 03/06/2015 0 1 2 04/06/2015 1 2 3 05/06/2015 3 8 4 06/06/2015 0 0 5 07/06/2015 4 6 6 08/06/2015 4 4 7 09/06/2015 5 9 9 11/06/2015 4 1 …

The DISCOUNT_DATES text file is successfully created.

The company now wants a program to:

  • key in a date entered by the user
  • search the text file for this date
  • if found, output one of the following messages:
  • o “No discount on this date” o “This is a discount date”

  • if not found, output “Date not found”

(i)

Add to the identifier table to show the variables you need for this new program.

Identifier Data type Description DISCOUNT_DATES FILE Text file to be used

[3]

Question 19

Topic relevance

Why this question appears here

72% assigned-topic match · Hardware › Logic gates and logic circuits

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_s15_qp_22.pdf

Keep practising this topic