-
What is a procedural language? Give an example.
A language in which each procedure or method is performed in a very specific order. The order of events is determined by the programmer. (C++)
-
What is a console application?
Applications that primarily use a keyboard and monitor without a graphical interface.
-
What is an event driven language? Give an example.
A language written for the Windows environment. The order of events is determined by the operator (Visual Basic).
-
What is a method?
A group of instructions designed to accomplish a specific task.
-
What are all Visual C# Console Applications composed of?
A Class and Main Method.
-
What is a class?
Classes are containers for holding data and coding.
-
What method contains the instructions that will direct our entire program?
Main Method
-
What does the term debug mean?
Process of removing program errors.
-
What is a variable?
Storage locations in memory that can be changed.
-
What is a constant?
Storage locations in memory that cannot be changed.
-
What is the term used to describe English-like statements that describe the logical steps necessary to solve a problem?
Pseudocode
-
What does the abbreviation IPO represent?
Input, Process, Output
-
Entering data from the keyboard is placed under which column on the IPO Worksheet?
Input column
-
What is a prompt?
Message displayed to the operator.
-
Prompting for data from the keyboard is placed under which column on the IPO Worksheet?
Output column
-
What programming structure specifies the order of tasks?
Sequence structure
-
How do you indicate a comment in a Visual C# program?
//
-
What is the term used to describe the general format of a statement and the information required?
Syntax
-
What are keywords?
Words in C# that have special meaning.
-
What class includes the Keyboard and Monitor?
Console
-
How do you write the statement to use the system namespace?
using System;
-
How do you write the statement to define a class named Hello?
class Hello
-
What is a static method?
A method that is not used with an object.
-
How do you write the statement to declare a static method named Main with no parameters that does not return a single value?
static void Main()
-
What characters are used to begin and end a block of statements?
- { left brace
- } right brace
-
How do you define a variable that is used to store your age as a whole number?
int ageInteger;
-
What data type is used to store a group of characters?
string
-
What characters are allowed in a C# name?
A-Z, a-z, 0-9 Underscore(_)
-
When using the naming convention rules for names, what should the last word of the variable name specify?
data type
-
How do you display the word "Hello" on the standard output device and move to the next line?
Console.WriteLine("Hello");
-
How do you display the prompt "Enter First Name:" on the standard output device and remain on the same line?
Console.Write("Enter First Name:");
-
How do you write the statement to store the value, input from the keyboard, to the variable ageString?
ageString=Console.Readline();
-
What is concatenation?
Process of attaching one string to another.
-
How would you write the variable lastNameString, followed by a comma and space, followed by the variable firstNameString to the monitor?
Console.WriteLine(lastNameString +","+firstNameString);
-
What is a syntax error?
Invalid C# statement.
-
What is a logic error?
When program does not execute correctly.
-
Calculations are placed under which column on the IPO Worksheet?
Process column
-
How would you write the statement to define a variable to store your Weight as a decimal number?
decimal weightDecimal;
-
How would you write the statement to define a variable to store your Middle Initial as a character?
char middleInitialChar;
-
What character ends a C# statement?
; (semicolon)
-
What method is used to convert a string to a numeric value?
Parse
-
How do you write the statement to convert your weight entered from the keyboard to the variable weightDecimal?
weightDecimal=decimal.Parse(Console.ReadLine());
-
What is the output of:
32/4 + 2 + 3 * 4 - 8%4
22
-
What is type casting?
Temporary conversion of a value from one data type to another.
-
How do you code the statement to calculate the average age (ageDecimal) of 3 students with ages of 21, 23, and 28 to decimal accuracy?
ageDecimal=(21+23+28)/3M;
or
ageDecimal=(21+23+28)/(decimal)3;
-
How do you code the statement to calculate a golfer's Average (avgDecimal) in decimals by dividing the golfer's Total (totalInteger) by 4?
avgDecimal=(decimal)totalInteger/4;
or
avgDecimal=totalInteger/4M;
-
What method is used to format a string for display purposes?
To String
-
How do you display the golfer's average score (avgDecimal) to 1 decimal to the standard output device?
Console.WriteLine(avgDecimal.ToString("N1"));
-
What is a standard method?
Method that returns zero or more values when completed.
-
What method returns a single value through the name of the method?
Value returning method
-
What is an argument list?
Used to send data (input) and receive values (output) when calling methods.
-
How do you call a standard method?
By specifying its name and argument list as a single statement.
-
How do you call a value returning method?
By specifying its name and argument list on a statement where the returned value will be used.
-
What is an input argument?
Data sent (input) to the called method.
-
What is an output argument?
Value received (output) from the called method when completed.
-
What is a parameter list?
Defines what data is needed and what values are returned by the method when completed.
-
What are Input Parameters?
Define what data is needed by the method to perform its tasks when called.
-
What are Output Parameters?
Define what values are returned to the calling method when completed.
-
What general information is specified on the standard method header?
Name of the method and the parameter list.
-
What general information is specified on the value returning method header?
The name of the method, parameter list. and return data type.
-
What type of parameter is generally not specified on a value returning method header?
Output parameters
-
How is the value returned from a value returning method?
Returns a single value through the name of the method.
-
What is appended or on the end to the Begin pseudocode task indicating that this method is a value returning method?
Return Type
-
What is the last pseudocode task before the end statement in a value returning method?
Return Value
-
How do you code the method heading named InputExamScores that returns 3 integer scores for exam1Integer, exam2Integer, and exam3Integer?
static void InputExamScores(out int exam1Integer, out int exam2Integer, out int exam3Integer)
-
How do you code the statement to input the variable weightInteger from the keyboard using the TryParse method?
int.TryParse(Console.ReadLine(),out weightInteger);
-
How do you code the value returning method header named Average with an integer input parameter named totalInteger that returns a decimal value?
static decimal Average(int totalInteger)
-
How do you return the decimal variable averageDecimal from a value returning method?
return averageDecimal
-
How do you call the method named InputExamScores that returns 3 integer scores for exam1Integer, exam2Integer, and exam3Integer?
InputExamScores(out exam1Integer, out exam2Integer, out exam3Integer);
-
How do you call the value returning method Average with an integer input argument named totalInteger that returns a decimal value assigned to avgDecimal?
avgDecimal=Average(totalInteger);
-
What is a constant?
A value that does not change during the execution of the program.
-
What type of constant can be referenced by any method in the class?
Class Constant
-
What type of constant can only be referenced in the method where it was defined?
Local Constant
-
What single pseudocode word begins all loop structures?
Do
-
What type of loop structure is used to repeat a group of statements zero or more times?
Pre-Test Loop Structure
-
What type of loop structure is used to repeat a group of statements one or more times?
Post-Test Loop Structure
-
What are the six pseudocode relational operators?
=, Not=, >, <, >=, <=
-
What are the three pseudocode logical operators?
AND, OR, NOT
-
What pseudocode logical operator requires only one condition be evaluated as true?
OR
-
What pseudocode logical operator requires all conditions be evaluated as true?
AND
-
How do you code a constant Maximum with a value of 300, and a constant GPA with a value of 3.5?
- const int MAXIMUM_Integer=300;
- const decimal GPA_Decimal=3.5M;
-
Can a C# statement be continued on several lines? How?
Yes, by placing a secmicolon (;) at the end of the last line.
-
What are the six Visual C# relational operators?
- == (Equal)
- != (Not Equal)
- > (Greater than)
- < (Less than)
- >= (Greater than or equal)
- <= (Less than or equal)
-
What are the three Visual C# logical operators?
-
How do you code the while condition to loop while the variable numberInteger is less than 50 or greater than 100?
while (numberInteger<=50 || numberInteger>=100)
-
What is an infinite loop?
Loop that doesn't stop
-
How do you stop an infinite loop?
CTRL + BREAK
-
What method is used to convert a string to uppercase?
ToUpper
-
How do you code the statement to capitalize a string variable named initialString input from the keyboard?
initialString=Console.ReadLine().ToUpper();
-
How do you code the while condition to loop while the variable codeString is not equal to "A" and not equal to "R"?
while(codestring!="A" && codeString!="R")
-
What Visual C# statement begins all Post-Test Loop Structures?
do statement
-
How do you code the last statement in a Post-Test loop structure to loop while codeString is Not="M" AND Not="F"?
}while(codeString!="M" && codeString!="F");
-
What word begins all pseudocode selection structures?
IF
-
What word ends all pseudocode selection structures?
END IF
-
What word is used to identify the "false" actions when you have two selections?
Else
-
What words are used in selection structures to test other conditions if you have three or more selections?
Else IF . . . Else
-
How do you write the pseudocode structure to Display "Go to the Beach" when the temperature is greater than 80 or Display "Go Shopping" when the temperature is less than or equal to 80?
- IF Temperature>80
- Display "Go to the Beach"
- Else
- Display "Go Shopping"
- END IF
-
How do you write the pseudocode structure to Display "Above Par", "Par", or "Below Par" when a Golf Score is greater than 70, equal to 70, or less than 70?
- IF Score>70
- Display "Above Par"
- Else IF Score=70
- Display "Par"
- Else
- Display "Below Par"
- END IF
-
How do you write the pseudocode structure to Display "Freshman" when Code=1, "Sophomore" when Code=2, "Junior" when Code=3, or "Senior" when Code=4?
- IF Code =1
- Display "Freshman"
- Else IF Code=2
- Display "Sophomore"
- Else IF Code=3
- Display "Junior"
- Else
- Display "Senior"
- END IF
-
How do you write the pseudocode structure to display "Lower Division" when the Code is "1" or "2"; otherwise display "Upper Division"?
- IF Code="1" or "2"
- Display "Lower Division"
- Else
- Display "Upper Division"
- END IF
-
How do you code the structure to display "Go to the Beach" when the temperature is greater than 80 or Display "Go Shopping" when the temperature is less than or equal to 80? Assume temperature is an integer)
- if (temperatureInteger>80)Console.WriteLine("Go to the Beach");
- else
- Console.WriteLine("Go Shopping");
-
How do you code the structure to display "Above Par", "Par", or "Below Par" when an integer Golf Score is greater than 70, equal to 70, or less than 70?
- if(scoreInteger>70)
- Console.WriteLine("Above Par");
- Else if(scoreInteger==70)
- Console.WriteLine("Par");
- Else
- Console.WriteLine("Below Par")
-
How do you code the statement to assign the variable codeString the letter X?
codeString="X";
|
|