2023 A Level

From TRCCompSci - AQA Computer Science
Revision as of 10:40, 6 February 2024 by Admin (talk | contribs) (Created page with "=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 st...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 character

s 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.