Question: Question Completion Status: Consider the following program that contains complex nested if-statements. Notice that some of the lines-of- code in the program are labeled by

 Question Completion Status: Consider the following program that contains complex nested

Question Completion Status: Consider the following program that contains complex nested if-statements. Notice that some of the lines-of- code in the program are labeled by numbers, 1, 2, 3, etc, on the right side. Suppose the input to this program was: temperature is 20, isWindy is FALSE, and isPercip is FALSE. Then the "flow of control", or "flow of execution", of this program will pass through the lines-of-code labelled 1,2,4,8,9 and none of the other labeled lines-of-code, and the output will be "you should ski". What labeled lines-of-code will executed if the input is: temperature = 50, isWindy is TRUE and isPercip is FALSE? Enter your answer as a list of integers, separated by commas, with NO BLANK SPACES and NO OTHER KEYSTROKES. int main() { printf( "\ What is the temperature? " ); int temp; scanf( "%d", &temp ); printf( "\ ls it percipitating? " ); int percipFlag; bool isPercip; scanf( "d", &percipFlag ); isPercip = percipFlag; printf( "\ ls it windy? " ); int windFlag; bool isWindy; scanf( "d", &windFlag ); isWindy = windFlag; if ( ! isPercip ) { 1/ 1 if ( temp > 70 ) 1/ 2 printf( "You should swim at the lakein" ); 1/ 3 else if ( temp > 30 ) I 1/ 4 if ( is Windy ) 1/ 5 printf("You should play soccerin" ); 1/ 6 else printf("You should play frisbee\ " ); 1/ 7 else if ( temp > 0 ) 1/ 8 printf( "You should skin" ); 1/ 9 else printf( "You should snowshoeln" ); 1/ 10 Click Save and Submit to save and submit. Click Save All Answers to save all answers. Save All Answers

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 Programming Questions!