Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 5

An environmental monitoring station uses a program to analyze noise pollution by summing the decibel levels from three sensors.

Due to weather interference, the recorded total noise level must be adjusted depending on wind conditions.

Write a C# program to calculate the final adjusted noise level.

You should assume that three integer variables called reading1, reading2, and reading3 have already been declared and assigned values representing the individual sensor readings.

Your program should:

  • Prompt the user to enter the wind interference level and store this in an integer variable.
  • Calculate the total noise level of the three sensor readings.
  • Apply the following adjustment rules:
    • If the wind interference level is exactly 2, the total noise level is reduced by 20.
    • If the wind interference level is greater than 2, the total noise level is divided by 4 (using integer division).
    • Ensure the final adjusted total noise level is never less than 5.
  • Output the final total noise level with a suitable, descriptive message.

You should use meaningful variable names and correct C# 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