Question: Do in Langauge C++ 1) [2 points] Describe two techniques for solving an application logic error. 2) [3 points] Write a validation loop to prompt

Do in Langauge C++

1) [2 points] Describe two techniques for solving an application logic error.

2) [3 points] Write a validation loop to prompt for and get from the user an integer whose square root is greater than 10.5. If an invalid integer is entered, print an error message and prompt the user again. After the loop, print the integer and its square root.

3) [3 points] Rewrite the validation loop from Question 2 using a do-while statement.

4) [5 points] Write a sentinel loop to prompt for and get from the user a series of angles. Continue to prompt for an angle until the sentinel value of your choice is entered. Within the loop, print the sine, cosine, and tangent of the angle. After the loop, print the number of angles processed.

5) [8 points] Write the number of for statement loops that will be performed for each of the following:

Initialization

Condition

Update

Loops?

a)

i = 7

i < 11

i++

b)

i = 14

i > 11

i--

c)

i = 2020

i <= 2050

i = i + 3

d)

i = 8

i < 400

i = i * 2

e)

i = 17

i < 7

i++

f)

i = 2

i < 6

i = i 6

g)

i = 5

i != 2

i = i 4

h)

i = 5

i != 9

i = i + 2

6) [2 points] Why do we use a while statement instead of a for loop to read data from a file?

7) [2 points] What is the primary difference between a void function and a value function?

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!