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
-
Explain how sellers costs, producer surplus, and the supply curve are related.
-
Schneeberger, Inc. is considering two alternatives to increase the acceleration of its linear motor actuators. The initial investment required in alternative X is $200,000 and in Y is $150,000. The...
-
The following MINITAB output presents a multiple regression equation y = b0 + b1x1 + b2x2 + b3x3. Test H0 : i = 0 versus H1: i 0 for i = 1, 2, 3. Use the = 0.05 level. The regression equation is...
-
On December 31, 2010, Hawthorne Corporation issued for $155,989, five-year bonds with a face amount of $150,000 and a stated (or coupon) rate of 9 percent. The bonds pay interest annually and have an...
-
The normal capacity of the Malloy Company is 20,000 direct labor hours and 10,000 units per month.A finished unit requires 15 pounds of materials at an estimated cost of $1.00 per pound.The estimated...
-
a. Create a spreadsheet model for this problem and solve it. What is the optimal solution? b. If Rick wanted to improve this solution, what additional resources would be needed and where would they...
-
GMP Securities Ltd is considering investing in four bonds. $5,000,000 in total is available for investment. The expected annual return, the worst-case annual return on each bond, and the volatility...
-
Find a general solution to the given Cauchy-Euler equation for t> 0. at dy +21-6y=0 dt- The general solution is y(t) = .
-
Find the derivative of the function *4-7x3+ x F(x)= in two ways: by using the Quotient Rule and by simplifying first. (Check that your answers are equivalent. Which method do you prefer?). Quotient...
-
A patron goes out for a meal. There is a tax of 5 . 9 5 % , and the restaurant patron will be giving a tip of 2 4 . 5 % on the post - tax amount. If the total paid ( in meal, tax, and tip ) was 2 5...
-
Given that f(x) = xh(x) h(-1) = 2 h'(-1) = 5 Calculate f'(-1)=
-
3. Design recursive algorithms for the following problems: (a) Compute the n-th Fibonacci number Fn. Recall that the n-th Fibonacci number is defined as follows. 1 Fn = { } Fn-1 + Fn-2 if n = 0, 1,...
-
I've had a busy shift at work meeting with clients, filing reports, and even snuck away during my shift for a phone interview for another job. Later, my manager stops by my desk to ask what all I've...
-
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...
-
Identify a company that integrates goods and services similar to the LensCrafters example. Use the framework in Exhibit 5.1 to write a short case study about the company in a similar fashion as the...
-
Airbags are designed to protect passengers from frontal or near-frontal crashes. Their designs and performance have improved dramatically since their introduction in the 1980s. Exhibit 5.19 shows a...
-
Glen County manages a waste-to-energy facility that burns 2,000 tons of trash per day and generates over \($20\) million in electricity annually while costing state and local taxpayers \($24\)...
Study smarter with the SolutionInn App