Question: Details Define and overload two void-typed functions named buildAcronym that assign a (pseudo)-random uppercase letter to two (2) or three (3) character parameters, depending on



Details Define and overload two void-typed functions named buildAcronym that assign a (pseudo)-random uppercase letter to two (2) or three (3) character parameters, depending on which buildAcronym is called. Each character in an acronym must be a unique uppercase letter (i.e. no repeat characters). Depending on the version of buildAcronym called, its two (or three) arguments will be assigned a random character literal, which can then be printed out in main. (6 points; 3 per buildAcronym definition) Additionally, define a third function named getRandomLetter that returns a (pseudo)-random uppercase letter. Think about what return type you'll need for that. You will call getRandomLetter inside your buildAcronym definitions every time you need a new random letter. Implementation In main, declare three char variables: a, b, and c, just in case the user wants a three-character acronym. We will learn much better ways of creating a collection of related variables later in the semester. Prompt the user to enter the size of the acronym. A valid acronym size falls within the range [2,3]. If the user enters an integer other than 2 or 3, reprompt the user until either value is entered. This value will determine which version of buildAcronym will be called: the version that builds to a two-character acronym (e.g. S.V.) or the version that builds a three-character acronym (e.g. S.G.V.). Once program control returns to main, print out the acronym in the format specified in the "Results" section. You cannot print these acronyms in buildAcronym. You must only use char parameters in your buildAcronym definitions. You must not use any string parameters. The only pre-defined functions you may call are srand, rand, and time. Results You will add periods ("") to the end of each character value. Your output will look like this: Acronym: (CHAR VARIABLE 1).[CHAR VARIABLE 2).(CHAR VARIABLE 3). Ex: Acronym: S.G.V
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
