ISDS 505 Midterm 1 Chapter 4 Decisions Questions and answers Latest 2024 Graded A
What is the output of the following code segment? int a = 3, b = 4; if(a == b) Write("X"); WriteLine("Y"); a. X b. Y c. XY d. nothing - Answer- b. Y What is the output of the following code segment? int a = 3, b = 4; if(a b) { Write("Y"); WriteLine("Z"); } a. Y b. Z c. YZ d. nothing - Answer- c. YZ What is the output of the following code segment? int a = 3, b = 4; if(a b) Write("Up"); else WriteLine("Down"); a. Up b. Down c. UpDown d. nothing - Answer- b. Down If the following code segment compiles correctly, what do you know about the variable x? if(x) WriteLine("OK"); a. x is an integer variable b. x is a Boolean variable c. x is greater than 0 d. none of these - Answer- b. x is a Boolean variable What is the output of the following code segment? int c = 6, d = 12; if(c d); Write("Green"); WriteLine("Yellow"); a. Green b. Yellow c. GreenYellow d. nothing - Answer- c. GreenYellow What is the output of the following code segment? int c = 6, d = 12; if(c d) if(c 8) Write("Blue"); else Write("Red"); else Write("Green"); a. Blue b. Red c. Green d. nothing - Answer- b. Red What is the output of the following code segment? int e = 5, f = 10; if(e f && f 0) Write("Red"); else Write("Orange"); a. Red b. Orange c. RedOrange d. nothing - Answer- b. Orange Which of the following expressions is equivalent to the following code segment? if(g h)
Geschreven voor
- Instelling
- ISDS 505
- Vak
- ISDS 505
Documentinformatie
- Geüpload op
- 18 maart 2024
- Aantal pagina's
- 9
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
isds 505 midterm 1 chapter 4 decisions questions a