Quelpr

CAPE Computer Science Unit 1 · 2014 · Paper 2 · Question 6(d)

For example, given 1000 10, the program prints: Old price: 1000 New Price with tax: 1100

Write a C program that accepts two values, price and tax (both of type float). The program applies tax to price and prints the old price and the new price in an appropriate message. Note that tax is given as a percentage.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 6(a)Explain why indentation is important in programming.[2 marks]
  2. 6(b)Why is it recommended that comments be used in programming code?[2 marks]
  3. 6(c)What output is produced by the following C program? (For the output state the values of i and j at each stage.)[11 marks]
  4. 6(e)Write C code to read four integers and print their average. (Do not write an entire program.)[4 marks]

More practice: the rest of this paper · more Procedural Programming Constructs in C questions · all CAPE Computer Science Unit 1 past papers