O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Computing I Packet 1

Vanessa Chen Inglês 57 flashcards

Flashcards do conjunto (57)

  1. 1The format specifier used to tell printf to expect a double precision floating point number is a percent sign followed by the character(s) _____.f
  2. 2The portion of the printf function call within the double quotes is called the _____.format string
  3. 3_____ is the decimal number 42 converted to an 8 bit binary number using 2's complement notation.00101010
  4. 4Each time a loop body executes is known as an _____.iteration
  5. 5int myValue; is called a _____.variable declaration
  6. 6What is the opposite of (x < 20 && x > 12)?x <= 12 || x >= 20
  7. 7Is printf used for input or output?output
  8. 8_____ is the decimal number associated with the ASCII character '0'48
  9. 9What is the correct conditional statement to determine if x is between 19 and 99?x > 19 && x < 99
  10. 10When must we use braces to define the body of a conditional expression?Multiple statements in the body
  11. 11The format specifier used to tell printf to expect an integer is a percent sign followed by the character(s) _____.d
  12. 12Write the loop condition to continue a while loop as long as x is negative.x < 0
  13. 13if-else statements that are inside other if-else statements are said to be _____.nested
  14. 14_____ is the decimal number -42 converted to an 8 bit binary number using 2's complement notation.11010110
  15. 15In a compound logical and (&&) expression, the evaluation of the expression stops once one of the terms of the expression is false. This is known as _____ evaluation.short-circuit
  16. 16The braces for a loop define the _____ of the loop.body
  17. 17A loop that always executes the loop body at least once is known as a _____ loop.do while
  18. 18What is the value of x after the following statements? double x; x = 15/4;3.0 (SNAKE integer operation)
  19. 19What is the output of the following code? int value; value = 33; printf("value\n");value
  20. 20What is the value of x after the following statement? double x; x = 3.0 / 4.0 + (3 + 2) / 5;1.75
  21. 21Given the following code fragment, and an input value of 5, what is the output? int x; printf("Enter a value\n"); scanf("%d", &x); if (x < 3) { printf("small\n"); } else { if (x < 4) { printf("medium\n"); } else { if (x < 6) { printf("large\n"); } else { printf("giant\n"); } } }large
  22. 22Another way to write the value 3452211903 is _____.3.452211903e09
  23. 23Given the following code fragment and the input value of 2.0, what output is generated? double tax; double total; printf("enter the cost of the item\n"); scanf("%lf", & total); if (total >= 3.0) { tax = 0.10; printf("%f\n", total + (total * tax)); } else { printf("%f\n", total); }2.0
  24. 24What is the output of the following code fragment? int x = 0; while (x < 0) printf("%d\n", x); x ++; printf("%d\n", x);an unending list of zeros (no brackets)
  25. 25GIven the following code fragment, what is the output? int x = 5; if (x > 5) printf("x is bigger than 5. "); printf("That is all."); printf("Goodbye\n");That is all. Goodbye
  26. 26What is the value of x after the following statement? double x; x = 3.0 / 4.0 + 3 + 2 / 5;3.75
  27. 27Given the following code fragment, which of the following expressions is always true? a. if (x < 3) b. if (x = 1) c. if (x == 1) d. if ((x / 3) > 1)b. if (x = 1)
  28. 28What is the value of x after the following statements? int x; x = x + 30;garbage (uninitialized)
  29. 29What is the value of x after the following statements? int x, y, z; y = 10; z = 3; x = y * z + 3;33
  30. 30What is the output of the following code? int value; value = 33; printf("%d\n", value);33
  31. 31Given the following code fragment and the input value of 4.0, what output is generated? double tax; double total; printf("enter the cost of the item\n"); scanf("%lf", & total); if (total >= 3.0) { tax = 0.10; printf("%f\n", total + (total * tax)); } else { printf("%f\n", total); }4.4
  32. 32Which of the following is not a valid identifier? a. myInteger b. total3 c. myInt d. returnreturn
  33. 33Given the following code fragment, what is the final value of y? int x, y; x = -1; y = 0; while (x < 3) { y += 2; x += 1; }8
  34. 34Which of the following lines correctly reads a value from the keyboard and stores it in the integer variable named myInt? a. scanf("%d", myInt); b. scanf("%d\n", myInt); c. scanf("myInt"); d. scanf("%d", &myInt);d. scanf("%d", &myInt);
  35. 35What is the value of x after the following statements? int x; x = 15 / 4;3
  36. 36Which is the following statements is NOT legal? a. char ch = "cc"; b. char ch = '0'; c. char ch = 65; d. char ch = 'b';a. char ch = "cc"; (double quotes are addresses)
  37. 37What is the correct way to write the condition y < x < z?((y < x) && (x < z))
  38. 38Given the following code fragment, what is the final value of y? int x, y; x = -1; y = 0; while (x <= 3) { y += 2; x += 1; }10
  39. 39Which is the following identifier? a. 3-com b. dollar$ c. 3com d. three_comd. three_com
  40. 40What is the value of x after the following statements? int x; x = 0; x = x + 30;30
  41. 41Given the following code fragment, and an input value of 3, what is the output that is generated? int x; printf("Enter a value\n"); scanf("%d", &x); if (x = 0) { printf("x is zero\n"); } else { printf("x is not zero\n"); }x is not zero (assignment, zero is false)
  42. 42What is the value of x after the following statements? int x; x = 15 % 4;3
  43. 43Executing one or more statements one or more times is known as _____.iteration
  44. 44What is the output of the following code? printf("This is a \\");This is a \
  45. 45What is the final value of x after the following fragment of code executes? int x = 0; do { x++; } while (x > 0);infinite loop
  46. 46What is the value of x after the following statements? double x; x = 0; x += 3.0 * 4.0; x -= 2.0;10.0
  47. 47T or F Variable names may begin with a number.F
  48. 48T or F Loops are used when we need our program to make a choice between two or more thingsF
  49. 49T or F After the following code fragment, x has the value of 3. int x = 3;T
  50. 50T or F The integer 0 is considered true.F
  51. 51T or F THe body of a while loop may never executeT
  52. 52T or F The body of a do-while loop always executes at least once.T
  53. 53T or F Every line in a program should have a comment.F
  54. 54T or F If x has the value of 3, y has the value of -2, and w is 10, is the following condition true or false? if (x < 2 && w < y)F
  55. 55T or F The opposite of (x > 3 && x < 10) is 10).F
  56. 56T or F The opposite of less than is greater than.F
  57. 57T or F It is legal to declare more than one variable in a single statement.T

Informações

Descrição
FlashCards sobre Computing I Packet 1, criado por Vanessa Chen em 04-05-2019.
Criado por
Vanessa Chen · mai 2019
Atualizado
5 mai 2019
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?