![]() ![]() ![]() I wasn’t really able to deduce the plan from the provided solution. ![]() If you have a suggestion as to how you’d do this, I’d greatly appreciate your insight too. No matter how long you boil it, its always cold by the time it reaches your plate. I know formulating a plan is the first step before actually writing the code, so if anyone can look through what I’ve written here and address my questions and overall approach that’d be great. Is there a way I can create a vector comprised of words from a string? If so, I’d then be able to iterate through it no problem. If the text were a vector, I’d iterate through that and then that’d return words, which I could then compare with the banned word “broccoli” and push_back() an asterisk or the word depending on whether or not they were equal, however it’s not a vector it’s a string. But I don’t know the best way to accomplish that, and even if I did, I’m confident there’s a better way to go about this. The only thing I can think of is to iterate through the std::string, and if characters “b”, “r”, “o”, “c”, “c”, “o”, “l”, “i” are produced in sequence, then replace them with “*”. It gives the correct answer to the prompts challenge, but codeacademy. This makes it difficult to compare with the banned word we’re given. 5-7 Bleep Bleep Broken Code So I have this, and it does exactly what it should do. The problem I’m having is that if you try to iterate through the given text, which is a std::string, you’ll get letters returned to you. When trying to plan a way to handle this, I came up with first iterating through the text given with a for loop. Here is the link to the lesson, and here is the solution. In the references and pointers section in the c++ course, we’re instructed to create a program bleep.cpp. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |