CSCI 105 Spring, 2009 Quiz 5 in Introduction to Computer Programming, Quizzes of Computer Science

A surprise quiz for the csci 105 introduction to computer programming course, offered in spring, 2009. The quiz consists of 11 multiple-choice and programming questions designed to assess students' understanding of various concepts in c# programming, such as variables, identifiers, conditional statements, and input/output operations.

Typology: Quizzes

Pre 2010

Uploaded on 08/07/2009

koofers-user-f3j
koofers-user-f3j 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCI 105 Introduction to Computer Programming Spring, 2009
Surprise Quiz #5
20 Points Name_________________________
1. What is the value of num after the following instructions are executed?
int num = 10, temp = 30;
num--;
num += temp;
2. Circle the all valid identifier names?
a) a_b_c b) int c) 123int d) NoOdLeS
3. Write a C# instruction that will take information from a textbox TextBox1 to a decimal number
unitPrice.
4. Write a C# instruction that would take information from a variable payRate and store it to a label Label5
formatted with 2 decimal places and a dollar sign.
5. Name 5 different components that you might include on a C# form.
6. Write the definition for a constant that would store the current minimum wage for Michigan employees.
pf2

Partial preview of the text

Download CSCI 105 Spring, 2009 Quiz 5 in Introduction to Computer Programming and more Quizzes Computer Science in PDF only on Docsity!

CSCI 105 Introduction to Computer Programming Spring, 2009 Surprise Quiz # 20 Points Name_________________________

  1. What is the value of num after the following instructions are executed? int num = 10, temp = 30; num--; num += temp;
  2. Circle the all valid identifier names? a) a_b_c b) int c) 123int d) NoOdLeS
  3. Write a C# instruction that will take information from a textbox TextBox1 to a decimal number unitPrice.
  4. Write a C# instruction that would take information from a variable payRate and store it to a label Label formatted with 2 decimal places and a dollar sign.
  5. Name 5 different components that you might include on a C# form.
  6. Write the definition for a constant that would store the current minimum wage for Michigan employees.
  1. What is the value of num after the following instructions are executed? int x=2, y=3, z=7; if (x > 4 && z > 4) num = 2 * y; else num = 2 * x;
  2. What is the value of num after the following instructions are executed? if (String.Compare(“Bob”, “Charlie”) != 0) num = 1; else num = 2;
  3. What is the value of num after the following instructions are executed? if (String.Compare(“Bob”, “Charlie”) >= 0) num = 1; else num = 2;
  4. What is the value of num after the following instructions are executed? int num = 0, x=5, y=8, z=3; if (x < num) num = x; if (y < num) num = y; if (z < num) num = z;
  5. Write a C# instruction that will check the value of the variable temp and display a message box with the text “negative”, “positive”, or “zero”, depending on temp’s value.