Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 16

A retail store is writing a program to calculate a customer's promotional bonus points across three separate purchases.

If any purchased items are subsequently returned, the customer's total bonus points are reduced.

Write a VB.NET program to calculate the final total bonus points.

You should assume there are three integer variables called p1, p2, and p3 which have already been declared and given values representing the points from each of the three purchases.

The program should:

  • Get the user to enter the number of returned items and store this number in a variable
  • Calculate the total bonus points for the three purchases
    • If exactly one item was returned, the total bonus points are reduced by 25
    • If more than one item was returned, the total bonus points should be halved
    • The total bonus points must not be less than 0
  • Return/output the final calculated total bonus points

You should use meaningful variable name(s) and VB.NET syntax in your answer.

[7]
Markscheme

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts

298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank