Write a function named aidojo that takes a an integer parameter n and return a string array answer of length n. The contents of the array are generated by counting i from 1 to n (inclusive) and adding the following values in each iteration: • "AI" if i is divisible by 3. • "Dojo" if i is divisible by 5. solve in python • "AIDojo" if iis divisible by 3 and 5. • i (as a string) if none of the above conditions are true. Example 1: Prompt: aidojo (3) Output: ["1","2","Pizz") Example 2: Prompt: aidojo (5) Output: ("1","2","Pizz","4", "Buzz") Example 3: Prompt: aidojo (15) Output: ["1","2","Fizz","4", "Buzz", "Fizz","7","8","Fizz", "Buzz","11", "Fizz","13","14", "FizzBuzz"]

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question
Write a function named aidojo that takes a an integer parametern and return a string array answer of length n. The contents of the array
are generated by counting from 1 to n (inclusive) and adding the following values in each iteration:
.
"AI" if í is divisible by 3.
• "Dojo" if i is divisible by 5.
solve in python
•
"AIDojo" if i is divisible by 3 and 5.
.
i (as a string) if none of the above conditions are true..
Example 1:
Prompt: aidojo (3)
Output: ["1","2","Pizz")
Example 2:
Prompt: aidojo (5)
Output: ("1","2", "Pizz","4", "Buzz")
Example 3:
Prompt: aidojo (15)
Output: ["1","2","Fizz","4", "Buzz", "Pizz","7","8","Fizz", "Buzz","11", "Fizz","13","14", "FizzBuzz"]
Transcribed Image Text:Write a function named aidojo that takes a an integer parametern and return a string array answer of length n. The contents of the array are generated by counting from 1 to n (inclusive) and adding the following values in each iteration: . "AI" if í is divisible by 3. • "Dojo" if i is divisible by 5. solve in python • "AIDojo" if i is divisible by 3 and 5. . i (as a string) if none of the above conditions are true.. Example 1: Prompt: aidojo (3) Output: ["1","2","Pizz") Example 2: Prompt: aidojo (5) Output: ("1","2", "Pizz","4", "Buzz") Example 3: Prompt: aidojo (15) Output: ["1","2","Fizz","4", "Buzz", "Pizz","7","8","Fizz", "Buzz","11", "Fizz","13","14", "FizzBuzz"]
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning