Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 41

A program is to be written to authenticate a username and password entered by the user.

Table 1 shows the only two pairs of valid credentials.

UsernamePassword
Guest101blue99
Manager202gold88

Write a C# program to authenticate a username and password.

The program should:

  • Ask the user to input a username
  • Ask the user to input a password
  • Display the message Access Denied if the username and password pair entered is not valid
  • Display the message Access Granted if the username and password pair entered is valid
  • Repeat these steps until a valid username and password pair is entered.

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