Question 5

AQA Computer Science June 2022 Paper 1 (7517/1)A level13 marks

On the specification

5.1
3.1 Fundamentals of programming
5.2
3.3 Systematic approach to problem solving
Question text

5 Write a program that asks the user to enter a string. It should then change the order of the vowels in the string and display the result. If there are n vowels in the string, the 1st vowel in the string should swap with the nth vowel in the string, the 2nd vowel in the string should swap with the (n-1)th vowel in the string, and so on. The letters a, e, i, o and u are the only vowels. Examples If the user enters the string horse then the program should display the string herso. If the user enters the string goose then the program should display the string geoso. If the user enters the string pinkfairyarmadillo then the program should display the string ponkfiaryarmidalli. If the user enters the string nakedmolerat then the program should display the string nakedmolerat. If the user enters the string lynx then the program should display the string lynx. If the user enters the string pig then the program should display the string pig. You may assume the string that the user enters will only contain lowercase letters. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 5.1 Your PROGRAM SOURCE CODE. [12 marks] 5.2 SCREEN CAPTURE(S) showing the results of three tests of the program by entering the strings persepolis, darius and xerxes. [1 mark] You are advised to spend no more than 20 minutes on this section. Type your answers to Section C into your Electronic Answer Document. You must save this document at regular intervals. These questions refer to the Preliminary Material and the Skeleton Program, but do not require any additional programming. Refer either to the Preliminary Material issued with this question paper or your electronic copy.