Need Help ?

Home / Expert Answers / Other / answer-the-mcqs-question-1-what-is-true-about-switch-statements-switch-statements-are-a-form-of-bran

(Answered): answer the mcqs QUESTION 1 What is true about switch statements? switch statements are a form of bra ...




QUESTION 1 What is true about switch statements? switch statements are a form of branching, but only when the conditions useQUESTION 2 What are all the values for user Int such that the switch statement below prints to screen 1, 2 buckle my shoe? swQUESTION 3 What is printed from the switch statement below when user Int has a value of 0? switch (user Int) { case 1: case 2QUESTION 4 Which of the following variables should NOT be declared as a constant variable? the gravitational acceleration neaQUESTION 6 Which of the following variable declarations is acceptable for a constant variable, following the best practices fQUESTION 8 What is the primary difference between a while loop and a do-while loop? the instructions in the body of a do-whilQUESTION 10 What is the focus of PROJECTO77 [read through all options before answering...] Analyzing exoplanet data from NASAanswer the mcqs
QUESTION 1 What is true about switch statements? switch statements are a form of branching, but only when the conditions use the "less than" relational operator (that is, <). switch statements are a form of looping, but only when the conditions use the "is equal to relational operator (that is, -). switch statements are a more general form of while loop (that is, any code that uses a while loop can be rewritten using a single switch statement). switch statements are a form of panching, but only when the conditions use the "is equal to" relational operator (that is, --). switch statements are a more general form of if-else statements (that is, any code that uses if-statements can be rewritten using a single switch statement). QUESTION 2 What are all the values for user Int such that the switch statement below prints to screen 1, 2 buckle my shoe? switch (userint) { case 1: case 2: printf("1,2 buckle my shoen"); break; case 3: case 4: printf("3,4 shut the doorn"); break; default: printf("Hot a valid Entry...n"); break: > Any integer less than 3. only 2 Any Integer 1 or 2 Any integer less than 1. QUESTION 3 What is printed from the switch statement below when user Int has a value of 0? switch (user Int) { case 1: case 21 printf("1,2 buckle my shoen"); break; case 3: case 4: printf("3,4 shut the doorn"); break; default: printf("Not a valid Intry...n"); break; 1.2 buckle my shoe 3,4 shut the door 1,2 buckle my shoe 3,4 shut the door Hot a valid Entry... 1,2 buckle my shoe 3,4 shut the door Not a valid Entry QUESTION 4 Which of the following variables should NOT be declared as a constant variable? the gravitational acceleration near the surface of the Earth, which is about g = 9.8 m/s^2 ?? (that is, pi, the ratio of circumference to diameter of any circle) that monetary value of a dime, weich is 10 cents a variable that will store the user-inputted value of their age the number of days in January for a calendar application QUESTIONS Which of the following is a valid way to declare a constant integer variable? const int MY_VALUE = 54 const int MY VALUE MY_VALUE - 54 const MY_VALUE - 54 constant int MY_VALUE - 54 constant MY_VALUE - 54 QUESTION 6 Which of the following variable declarations is acceptable for a constant variable, following the best practices for constant variable naming convention? const int NumjanuaryDays - 31; const int numjanuaryDays - 31; const int NUMjanuaryDAYS - 31; const int NUMJANUARYDAYS = 31; const int NUM JANUARY_DAYS 31; QUESTION 7 Given the enumeration declaration below, what value is stored in the constant variable CLUB? enum suit HEART, DIAMOND, CLUB, SPADE): 2 1 Ace QUESTION 8 What is the primary difference between a while loop and a do-while loop? the instructions in the body of a do-while loop are guaranteed to be executed at least once, whereas while-loop instructions may never be executed if the condition is false at the start a do-while loop cannot have branching inside the loop, whereas a while loop can have branching inside do-while loops are best used for situations with a predetermined counting pattern, whereas while loops are more freeform with a general usage while loops are the best option for checking that user-input is valid, whereas do-while loops are not a good choice for input validity checks QUESTION 9 What is the functionality of this code snippet? int count = 0; char userStr[1001 fgets userStr 100 stdin for(int i = 0; i <strlen(userStry: ++){ if (isspace(user Strom count++ 3 ) printf("%d", strlen(user Str) - count) The code determines the length of the user-inputted string and prints the value out. That is, it prints out the total number of characters in the user's message The code always prints out because there cannot be spaces in a string. The code always prints out 100, because that is the size of the character array The code determines the number of non-whitespace characters in the user inputted string and prints the value out. That is, it prints out the total number of alphanumeric or punctuation characters (everything but whitespaces) in the user's message. The code determines the number of spaces in the user inputted string and prints the value out. That is, it prints out the total number of whitespace characters in the user's message QUESTION 10 What is the focus of PROJECTO77 [read through all options before answering...] Analyzing exoplanet data from NASA. Analyzing the heights of the tallest mountains in the world. Analyzing COVID-19 data. Analyzing the voltages and currents in an electric circuit. Any of the above could be the focus of your PROJECTO7 because it is an open-ended project where each student gets to choose a real world data set to analyze. Of course, there are infinite other options as well...


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to QUESTION 1 What is true about switch statements? switch statements are a form of branching, but only when the conditions...

The Problem has Answer!

We have detailed solutions for you for more understanding.

View Answer