Questions Question 1: Wheel of Fortune! If you ever watched the game show Wheel of Fortune!...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Questions Question 1: Wheel of Fortune! If you ever watched the game show "Wheel of Fortune!" you'll know that contestants have to solve a puzzle. The clue is a multi-word text string (an expression, a place, etc) with the characters blanked out. Typically, you need to "buy" vowels but in this assignment all vowels and special characters are shown to the user. Only the consonants are hidden. Your wheel of fortune function will take a char string answer as input and output a char string "clue" with all the consonants removed: Example: chara_puzzleTxt=wheelOfFortune("HELLO-WORLD"); // would mean a puzzleTxt stores "_E_O__O______ . . . . In the main method, test our wheelofFortune function with a variety of different "answers". You can use a printf statement to see what the answers and the corresponding puzzles will be. You can use those same answers in your wheel of torture testing. The returned array: . You may assume that the answers are all capital letters. o Bragging Bonus (do it for glory....you just don't get points for doing this): Make the function work for upper and lower case characters . The letter "Y" is considered a consonant, despite it sometimes being a vowel. wheelOfFortune that takes a character array (char* a_answer for example) as an input parameter and returns a char array (char* is the return type). You should not modify a_answer. Therefore, you will need to make a new char array to put your answer. You will return that new array Temporarily (don't pass this in) make a static char array of size 200 and use that for the array you return. What's wrong with that solution? You should be able to write all the code and things will compile. What happens when you test this? (think about this. No need to give an answer). After trying this with a static array, use malloc (and free it later in the main function) to make a dynamic character array. O o 0 You are not allowed to use new or delete (C++ code). 0 We will use new/delete in BIT 2400. o NOTICE: strien returns the length of a string.. but it does not include the 0 at the end. That was my bug when I did the assignment. The error returned can be difficult to figure out so I wanted to point this out. Hint 1: Copy all characters from a answer to the array you will output (the puzzle) using a for loop and []. For example, a answer[i] is the ith character in the array (counting from 0) and your for loop would change i each time through the loop. If the character being copied is a consonant, however, save in your puzzle / output array. You can take a different approach, but I don't see why you would. Hint 2: You may want to write a helper function or two. Otherwise the code can get hard to debug and you replicate code, Questions Question 1: Wheel of Fortune! If you ever watched the game show "Wheel of Fortune!" you'll know that contestants have to solve a puzzle. The clue is a multi-word text string (an expression, a place, etc) with the characters blanked out. Typically, you need to "buy" vowels but in this assignment all vowels and special characters are shown to the user. Only the consonants are hidden. Your wheel of fortune function will take a char string answer as input and output a char string "clue" with all the consonants removed: Example: chara_puzzleTxt=wheelOfFortune("HELLO-WORLD"); // would mean a puzzleTxt stores "_E_O__O______ . . . . In the main method, test our wheelofFortune function with a variety of different "answers". You can use a printf statement to see what the answers and the corresponding puzzles will be. You can use those same answers in your wheel of torture testing. The returned array: . You may assume that the answers are all capital letters. o Bragging Bonus (do it for glory....you just don't get points for doing this): Make the function work for upper and lower case characters . The letter "Y" is considered a consonant, despite it sometimes being a vowel. wheelOfFortune that takes a character array (char* a_answer for example) as an input parameter and returns a char array (char* is the return type). You should not modify a_answer. Therefore, you will need to make a new char array to put your answer. You will return that new array Temporarily (don't pass this in) make a static char array of size 200 and use that for the array you return. What's wrong with that solution? You should be able to write all the code and things will compile. What happens when you test this? (think about this. No need to give an answer). After trying this with a static array, use malloc (and free it later in the main function) to make a dynamic character array. O o 0 You are not allowed to use new or delete (C++ code). 0 We will use new/delete in BIT 2400. o NOTICE: strien returns the length of a string.. but it does not include the 0 at the end. That was my bug when I did the assignment. The error returned can be difficult to figure out so I wanted to point this out. Hint 1: Copy all characters from a answer to the array you will output (the puzzle) using a for loop and []. For example, a answer[i] is the ith character in the array (counting from 0) and your for loop would change i each time through the loop. If the character being copied is a consonant, however, save in your puzzle / output array. You can take a different approach, but I don't see why you would. Hint 2: You may want to write a helper function or two. Otherwise the code can get hard to debug and you replicate code,
Expert Answer:
Answer rating: 100% (QA)
Answer 1 The correct solution for this problem is to create a new dynamic character array that is the same size as the input array This array should b... View the full answer
Related Book For
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe
Posted Date:
Students also viewed these electrical engineering questions
-
If you have ever watched the launching of an Earth satellite, you may have noticed that the rocket starts vertically upward, then departs from a vertical course and continues its climb at an angle....
-
As shown in Fig. P6.94, a multi duct cross section consists of seven 2-cmdiameter smooth thin tubes packed tightly in a hexagonal bundle within a single 6-cm-diameter tube. Air, at about 20°C and...
-
A wagon wheel is constructed as shown in Fig. 9.30. The radius of the wheel is 0.300 m, and the rim has mass 1.40 kg. Each of the eight spokes that lie along a diameter and are 0.300 m long has mass...
-
5t-6, x <2 2x4 find f '(x) and give its domain. 2x+8, x>4 Given f(x)=x
-
Based on what you learned from reading this chapter and from studies you uncovered on the Web, which of the financial firms listed below are most likely to benefit from economies of scale or scope...
-
In the final stage of the manufacturing process for a solid organic product, the product is cleaned with liquid toluene and then dried in a process whose flowchart is shown on the next page 10 . The...
-
Plaintiff purchases a new car that has defects in its paint job. Three times the dealership repaints the care, but to no avail. The plaintiff continues to drive the car as he has no other option in...
-
Allison Corporation acquired 90 percent of Bretton on January 1, 2016. Of Bretton's total acquisition- date fair value, $60,000 was allocated to undervalued equipment (with a 10-year remaining life)...
-
3. You have been provided with the information listed below for the City of XYZ. 2024 2025 market value of taxable property $1.3 billion increases by 2.0% from 2024 exemptions $26 million increases...
-
During 2008 the US economy stopped growing and began to shrink. Table 1.25 gives quarterly data on the US Gross Domestic Product (GDP), which measures the size of the economy. (a) Estimate the...
-
How do they relate to modern leadership concepts? Consider how historical contexts influence leadership styles (Exodus 3-4). Also, consider the information presented in the Northouse Introduction....
-
(iii) Find the complexity of the following methods: public void first(){ for(int i = 0; i < N; i++){ System.out.println("Hello, World!"); } public static void second () { for(int i = 0; i < N; i++){...
-
what is the what is the difference between a justification defense and an excuse defense? Which is self defense and why ? Difference between a justification defense and an excuse defense? Which is...
-
In ABC Corporation, the Cash Short and Over account is used to reconcile discrepancies in cash transactions. What classification does this account take, serving as either a Misc. Expense or Misc....
-
Existen diferencias en los clculos con el mtodo PEPS y UEPS? Seleccione una: S, nicamente en los Gastos Operativos Ninguna, es igual usar cualquiera de los dos mtodos S, el PEPS usa el ltimo costo...
-
Implementing Project 7 - File I/O Sample Results Note: Except for the menu changes noted below, output should not change from Project 5. However, saving the contact book, exiting the program,...
-
A consumer finds only three products, X, Y, and Z. are for sale. The amount of utility yielded by their consumption is shown in the table below. Assume that the prices of X, Y, and Z are $10, 52, and...
-
The Alert Company is a closely held investment-services group that has been very successful over the past five years, consistently providing most members of the top management group with 50% bonuses....
-
A market research consultant hired by a leading soft drink company is interested in determining whether there is a difference between the proportions of female and male consumers who favor the...
-
Techware Incorporated is considering the introduction of two new software products to the market. In particular, the company has four options regarding these two proposed products: introduce neither...
-
In a large accounting firm, the proportion of accountants with MBA degrees and at least five years of professional experience is 75% as large as the proportion of accountants with no MBA degree and...
-
A new business analyst needs to be hired to work at the corporate headquarters of a retail firm. Jared and Amanda are managers in charge of the hiring decision. The candidates have been narrowed down...
-
In the same league as Amazon Inc., Microsoft, and Alphabet Inc., the Chinese multinational investment holding Tencent is considered one of the worlds biggest companies in the gaming industry. Founded...
-
Employees first is the most important cultural value that former HCL Technologies CEO Vineet Nayar believed would help the company to grow. While most managers think a customers satisfaction should...
Study smarter with the SolutionInn App