Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, could you guys help me with this C++ codes please. 4.11 Assignment Part 2: Fizz Buzz Deluxe Fizzbuzz is a game where players count

Hi, could you guys help me with this C++ codes please.image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

4.11 Assignment Part 2: Fizz Buzz Deluxe Fizzbuzz is a game where players count incrementally, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz". If the number is divisible by both three and five it becomes "fizzbuzz" User-defined Words and Divisors In this lab, you will write a program that accepts a pair of words from the user (e.g. "fizz" and "buzz"), as well as a pair of integers (e.g. 3 and 5). Using these words and "divisors" the program will output the results of counting from 1 to 100. Every number divisible by the first divisor (eg. 3) will be replaced by the first word (e.g. "fizz"), and every number divisible by the second divisor (e g. 5) will be replaced by the second word (e.g. "buzz"). If the number is divisible by both, it will be replaced by the first and second words concatenated together (e.g. "fizzbuzz"). User input will be validated. The words must be between 3-6 characters in length, and the two divisors must be between 2 and 15 (inclusive) and must not be the same. Keep prompting the user for the words (or divisors) until they input a valid pair. Output Sequence Count from 1 to 100, substituting numbers with words as appropriate. Precede each number or word with a space. After every 10 items, output a newline. Symbolic Output Now repeat the counting algorithm, but this time use the symbols listed here (preceding each with a space, 10 symbols to a line): + divisible by first divisor *divisible by second divisor t divisible by both divisors .everything else Hints 1) Use while loops for the input validation portion. 2) Output a newline after getting the user input. 3) You'll want to use the modulus () operator. 4) The length of a string can be evaluated with stringvar.size). Sample Runs == Fizz Buzz Deluxe- Enter a pair of words (each from 3-6 chars long): fizz buzz Enter two different integers (between 2 and 15): 3 5 1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz 31 32 fizz 34 buzz fizz 37 38 fizz buzz 41 fizz 43 44 fizzbuzz 46 47 fizz 49 buzz fizz 52 53 fizz buzz 56 fizz 58 59 fizzbuzz 61 62 fizz 64 buzz fizz 67 68 fizz buzz 71 fizz 73 74 fizzbuzz 76 77 fizz 79 buzz fizz 82 83 fizz buzz 86 fizz 88 89 fizzbuzz 91 92 fizz 94 buzz fizz 97 98 fizz buzz == Fizz Buzz Deluxe- Enter a pair of words (each from 3-6 chars long): ping pong Enter two different integers (between 2 and 15): 49 1 2 3 ping 5 6 7 ping pong 10 11 ping 13 14 15 ping 17 pong 19 ping 21 22 23 ping 25 26 pong ping 29 30 31 ping 33 34 35 pingpong 37 38 39 ping 41 42 43 ping pong 46 47 ping 49 50 51 ping 53 pong 55 ping 57 58 59 ping 61 62 pong ping 65 66 67 ping 69 70 71 pingpong 73 74 75 ping 77 78 79 ping pong 82 83 ping 85 86 87 ping 89 pong 91 ping 93 94 95 ping 97 98 pong ping -= Fizz Buzz Deluxe == Enter a pair of words (each from 3-6 chars long): hey ho Enter a pair of words (each from 3-6 chars long): programmer skillz Enter a pair of words (each from 3-6 chars long): dot dash Enter two different integers (between 2 and 15): 0-1 Enter two different integers (between 2 and 15): 77 Enter two different integers (between 2 and 15): 6 11 1 2 3 4 5 dot 78 9 10 dash dot 13 14 15 16 17 dot 19 20 21 dash 23 dot 25 26 27 28 29 dot 31 32 dash 34 35 dot 3738 39 40 41 dot 43 dash 45 46 47 dot 49 50 51 52 53 dot dash 56 57 58 59 dot 61 62 63 64 65 dotdash 67 68 69 70 71 dot 73 74 75 76 dash dot 79 80 81 82 83 dot 85 86 87 dash 89 dot 91 92 93 94 95 dot 97 98 dash 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

=+j Describe how EU directives impact IHRM.

Answered: 1 week ago

Question

=+and reduction in force, and intellectual property.

Answered: 1 week ago