2023 A Level

From TRCCompSci - AQA Computer Science
Jump to: navigation, search

Question

Write a program that gets the user to enter a string. It should keep getting the user to enter a string until they enter a valid string.

Each time they enter a string an appropriate message should be displayed telling them whether the string is valid or not.

For a string to be valid:

  • It must be between 5 and 7 characters in length (inclusive)
  • It must consist only of uppercase characters
  • It must contain only unique characters (ie no character should appear in the string more than once)
  • The sum of the ASCII codes for the characters in the string must be between 420 and 600 (inclusive)

Evidence you need to provide

  1. Your Program Source Code
  2. Screen Capture(s) showing the results of testing your program by entering BOIL, BRAisE, ROAST, BLANCH, and PRESSURECOOK. You will need to execute your program more than once to test all of the strings.