Home / Expert Answers / Computer Science / 4-write-a-function-that-takes-as-input-a-positive-value-i-and-which-returns-true-if-i-pa552

(Solved): 4. Write a function that takes as input a positive value \( i \) and which returns True if \( i \) ...



4. Write a function that takes as input a positive value \( i \) and which returns True if \( i \) is divisible by either 3 o

4. Write a function that takes as input a positive value \( i \) and which returns True if \( i \) is divisible by either 3 or 5 (or both). 5. Write a function that takes as input a positive value \( n \) ans which determines how many of the numbers \( 1,2,3,4, \ldots, \mathrm{n} \) are divisible by neither 3 nor 5 . (So how many are not divisible by 3 and not divisible by 5.) This function must call your function from the previous question. What does your program determine when \( \mathrm{n}=100 ? \mathrm{n}=1000 \) ? 6. Write a function called isSubstring that takes as input a string \( S \) and a string \( x \) of length exactly 2. Your function should return True if string \( S \) contains \( x \) as a substring, and False otherwise. For example: - isSubstring( "abcdef", "cd" ) should return True - isSubstring( "abcdef", "ef") should return True - isSubstring( "abcdefghijk", "gi" ) should return False


We have an Answer from Expert

View Expert Answer

Expert Answer


4. #include using namespace std; // Function to find that number divisibl
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe