Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions