Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 8

A research weather station is writing a program to calculate a cumulative atmospheric telemetry reading across three independent sensors.

Due to transient environmental interference, the calculated total reading must be adjusted before being recorded.

Write a VB.NET program to calculate the final corrected telemetry reading.

You should assume there are three integer variables called s1, s2, and s3 which have already been declared and given values representing the raw readings from each of the three sensors.

The program should:

  • Get the user to enter the number of active solar flares and store this integer in a variable
  • Calculate the total reading from the three sensors
    • If exactly one solar flare was active, the total reading is reduced by 40
    • If more than one solar flare was active, the total reading should be reduced to one-third of its value (integer division is acceptable)
    • The final corrected reading must not be less than 0
  • Return/output the final corrected telemetry reading

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