Chp 2 _ Data Processing AI Flashcards

(110 cards)

1
Q

Define the information systems process

A

Input → CPU processing → Output of data as useful information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name the types of data used in programming

A

Numeric, string, char, bool, decimal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you declare a variable?

A

DataType VariableName;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What rules apply to variable naming?

A

First char letter/underscore; no spaces; no keywords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is required to read inputs and format outputs?

A

Use appropriate controls and ToString/Parse methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you convert data types when reading input?

A

Use Parse methods like int.Parse or Convert.ToX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which operators perform calculations?

A

Arithmetic operators: +, -, *, /, %

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is data processing?

A

Reading, storing, and processing data during program execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give examples of input devices

A

Keyboard and mouse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is “process” in information systems?

A

CPU operations on entered data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is output in information systems?

A

Results presented as useful information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a TextBox control?

A

Rectangular area for keyboard input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Where is TextBox found in Toolbox?

A

Common Controls group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you add a TextBox to a form?

A

Double-click it in the toolbox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the default TextBox name?

A

textBoxn (n = 1,2,…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does TextBox.Text store?

A

User input as a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How to assign “Hello” to TextBox?

A

textBox1.Text = “Hello”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How to clear a TextBox?

A

textBox1.Text = “”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a variable?

A

A memory storage location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What represents a variable’s memory location?

A

Its variable name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What must you do before using a variable in C#?

A

Declare it with a data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Syntax to declare a variable?

A

DataType VariableName;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Why must variables have data types?

A

Defines the type of data they can hold

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What do primitive data types store?

A

Fundamental types like strings and integers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Give examples of C# numeric data types
int, float, double
26
What data type holds text?
string
27
What data type holds one character?
char
28
What data type holds true/false?
bool
29
Valid first characters for names?
Letter or underscore
30
Can names contain spaces?
No
31
Use of C# keywords as names?
Not allowed
32
Best practice for naming variables?
Choose meaningful names
33
What does a string hold?
Any combination of characters
34
How to assign a string value?
Use quotes: var = "Text";
35
How to set a Label’s text?
productLabel.Text = productDescription;
36
How to show a string in a MessageBox?
MessageBox.Show(productDescription);
37
What is string concatenation?
Appending one string to another
38
Which operator concatenates strings in C#?
+
39
When must you declare variables?
Before using them
40
How do you assign to a declared variable?
Use the = operator
41
What is a local variable?
Declared inside and scoped to its method
42
Define variable scope
Program region where variable is accessible
43
Define variable lifetime
Time variable exists in memory during execution
44
Can a local variable be accessed outside its method?
No
45
When can you assign a value to a variable?
If type matches variable’s data type
46
How many values can a variable hold?
One at a time
47
Must you initialize a variable before use in C#?
Yes
48
How to declare multiple same-type variables?
Type var1, var2, var3;
49
Which types for math operations?
Numeric types like int, double
50
What is int’s value range?
-2,147,483,648 to 2,147,483,647
51
Which type stores fractional numbers?
double
52
What is a numeric literal?
Number in code without quotes
53
What is the decimal type?
128-bit high-precision numeric type
54
Where is decimal commonly used?
Financial and monetary calculations
55
What suffix for decimal literals?
M or m
56
What is explicit conversion?
Type casting
57
Cast decimal to int?
(int)decimalValue
58
Cast decimal to double?
(double)decimalValue
59
Operator for addition?
+
60
Operator for subtraction?
-
61
Operator for multiplication?
*
62
Operator for division?
/
63
Operator for remainder?
%
64
How to enforce order of operations?
Use parentheses
65
Result type of int + double?
double
66
Result type of int + decimal?
decimal
67
Can you mix double and decimal?
No
68
Result of integer division?
Integer quotient only
69
How to get decimal result from ints?
Cast operands to double
70
What type does TextBox input return?
String
71
Convert string to int?
int.Parse(string)
72
Convert string to double?
double.Parse(string)
73
Convert string to decimal?
decimal.Parse(string)
74
How to convert number to string?
myNumber.ToString()
75
How to show number in MessageBox?
MessageBox.Show(myNumber.ToString())
76
Implicit number-to-string conversion?
Use "text" + number
77
Specifier for number format?
N or n
78
Specifier for fixed point?
F or f
79
Specifier for exponential?
E or e
80
Specifier for currency?
C or c
81
Specifier for percentage?
P or p
82
What is an exception?
Unexpected runtime error
83
What is a try-catch statement?
Structure to handle exceptions
84
Where to place risky code?
Inside try block
85
Where to handle exceptions?
Inside catch block
86
What happens on invalid parse?
An exception is thrown
87
Display default exception message?
MessageBox.Show(ex.Message)
88
Show custom error message?
MessageBox.Show("Invalid data was entered.")
89
What is a constant?
Named value that cannot change
90
How to declare a constant?
const Type NAME = value;
91
Constant naming convention?
Uppercase letters
92
What is a field?
Variable declared at class level
93
What is field scope?
Entire class
94
When is a field created?
When its class instance is created
95
What does Math.Sqrt(x) do?
Returns the square root of x
96
What does Math.Pow(x,y) do?
Returns x raised to the power y
97
What is Math.PI?
Ratio of circumference to diameter
98
What is Math.E?
Base of natural logarithm
99
What is an access key?
Alt+letter mnemonic for control
100
How to assign an access key?
Add '&' before the letter in Text
101
Is access key case-sensitive?
No
102
Which property sets background color?
BackColor
103
Which property sets text color?
ForeColor
104
What tabs are in color list?
Custom, Web, System
105
What property sets form background image?
BackgroundImage
106
What property sets image layout?
BackgroundImageLayout
107
Layout options?
Tile, Center, None, Stretch, Zoom
108
Which container shows a title?
GroupBox
109
Which container lacks a title?
Panel
110
Which container supports border style?
Panel