Question: 1. Write a function to test whether a given number is a multiple of 8. A one (1) is returned if the given number is

1. Write a function to test whether a given number is a multiple of 8. A one (1) is returned if the given number is a multiple of 8. Otherwise, a zero (0) is returned. The number to be tested is an integer and is an argument to this function.

2. Write a switch statement that will examine the value of an integer variable yy and assign one of the following values to the variable dd, depending on the value of yy:

(a)15, if yy == 1

(b)25, if yy == 2

(c) 35, if yy == 3

(d)45, if yy == 4

(e) 55, if yy == 5

3. Write a loop to compute the sum of the squares of the first 100 odd integers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!