PSUEDOCODE ONLY!!
What is the output of the following code?
CREATE x 1
SWITCH (x)
Print output here:
Print output here:
BREAK
CASE 2: PRINTLINE (“hELLO wORLD”)
CASE 3: PRINT (“HELLO WORLD”)
BREAK
CASE 4: PRINTLINE(“Hello”)
CASE 5: PRINT(“World”)
BREAK
DEFAULT: BREAK
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
Initially x is 1
It enters the switch and it will execute print output here 2 times and will brek the switch and will not execute anything.
Kindly revert for any queries
Thanks.
PSUEDOCODE ONLY!! What is the output of the following code? CREATE x 1 SWITCH (x) Print...
In java - Question 5 (Which CASE? - 10 pts) – What is the output of the following code? CREATE x <-- 5 SWITCH (x) C ASE 1: PRINTLINE (“hello world”) BREAK CASE 2: PRINTLINE (“hELLO wORLD”) CASE 3: PRINT (“HELLO WORLD”) BREAK CASE 4: PRINTLINE(“Hello”) CASE 5: PRINT(“World”) BREAK DEFAULT: BREAK
PLEASE DO THIS IN PYTHON!! Question 5 (Which CASE? - 10 pts) – What is the output of the following code? CREATE x <-- 5 SWITCH (x) CASE 1: PRINTLINE (“hello world”) BREAK CASE 2: PRINTLINE (“hELLO wORLD”) CASE 3: PRINT (“HELLO WORLD”) BREAK CASE 4: PRINTLINE(“Hello”) CASE 5: PRINT(“World”) BREAK DEFAULT: BREAK
1. What would be the output of the following lines of code: int num = 2; switch(num){ case 1: cout << "1"; case 2: cout << "2"; case 3: cout << "3"; case 4: cout << "4"; } 2. What would be the output of the following code: char op = '*'; switch(op){ case '+': cout << "Addition"; break; case '-': cout << "Subtraction"; break; case '/': cout << "Division"; break; default: cout << "Invalid"; } 3. What would be...
Covert C++ code into MIPS. -If x has a value if 2, print "bbb" if x has a value of 3, print "ccc" if x has a value of 4, print "ddd" if x has a value other than 2, 3, or 4 print "eee". result = ""; switch (x) { case 2: result = result + "bbb"; break; case 3: result = result + "ccc"; break; case 4: result = result + "ddd"; break; default: result = result +...
Question 5: Consider the following C++ program. switch(x) case 1: if (x > 1) case 2: if (x > 3) case 3: cout<<"Epic Beats!" << endl; case 4: cout << "Chill Vibes" << endl; break; case 5: cout << "Sweet Jazz" << endl; break; default: cout << "Invalid input. Try again."; A. What is the output if x = 1? B. What is the output if x = 3? C. What is the output if x = 2? D. What...
20) What is the output of the following segment of C code: int avg(int n, int* a); int main () { int array[4]={1,0,6,9}; printf("%d", avg(4, array)+ 1); system("pause"); return 0; } int avg(int n, int* a) { int i, sum=0; for (i=0;i<n;i++) { sum+=a[i]; } return sum/n; } a) 16 b) 5 c) 4 d) 8 21) What is the output of the following segment of C code: int x = 2; int y = 3;...
in c# 1- What is the output for total after the following segment of code executes? int num = 3, total = 0; switch (num) { case 1: case 2: total = 5; break; case 3: total = 10; break; case 4: total = total + 3; break; case 8: total = total + 6; break; default: total = total + 4; break; } WriteLine("The value of total is " + total); The value displayed for total would be ....
all
in pseudocode
Question 1) Warmup question: Write a function named True False() (only the function, no main is needed) that takes in a number and determines if it is evenly divisible by 5 (le, returns true or false). (15 points) Answer is in: Pseudocode CHO Java0 C+0 Page 17 Question 3) 2D Arrays The IRS has contracted you to process a 10x10 array of floating point numbers called Taxes and sum up all negative numbers in the array so...
C++ Program What is the output of the following code fragment?(beta is of type int.) beta = 5; do { switch (beta) { case 1: cout <<'R'; break; case 2: cout case 4: cout << 'O'; break; case 5: cout << 'L'; } beta--; }while (beta>1); cout <<'X';
What is the output from the following code segment? Output from PRINTLINE 1: public static void Main(){ int x = 38; int y = 45; int z = DoIt(ref x, ref y); PRINTLINE(x + “ “ + y + “ “ + z); // PRINTLINE 1 } static int DoIt(ref int a, ref int b) { a /= 8; b /= 7; PRINTLINE(a + “ “ + b); // PRINTLINE 2 return (a + b);...