Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# class i need help please Question 1 You are given a form with three TextBoxes

ID: 3737886 • Letter: C

Question

C# class i need help please

Question 1

You are given a form with three TextBoxes. One of them is name txtFirstName, the other txtLastName, and the last one txtCount. The initial values for txtCount is 0, and for first name and last name are empty string.

Write the following code.

1a. Save the text in all the TextBoxes into three variables. Use proper types.

2b. Remove Any trailing spaces with Trim.

3c. Check if the first name and the last name are the same.

4d. If they are the same, output using a message box. "First Name and Last Name are the same". Then, increment the counter variable that you obtained from txtCount and update txtCount with this new value.

5e. If there are NOT the same, then set txtCount to zero, and output in a message box "First Name: Francisco -- Last Name: Ortega", assuming that the user type Francisco and Ortega in each respective textboxes.

Question 2

Briefly Describe how the && and || operator works

Question 3

Describe four Data types in C# and describe their usage

Question 4

Describe the steps required to create a simple application with one form, one text box, and one button in Visual Studio (IDE).

How do you change the name of the form using the Property box?

Describe at least 5 additional properties you can change in either the form, the textbox, or the command button.

Question 5

Describe how TryParse works

Explanation / Answer

2)Answer:

&&:

The && operator takes two boolean expressions as operands and creates a boolean expression that is true only when both subexpressions are true. It also performs short-circuit evaluation. If the expression of the left of the && operator is false, the expression on the right side will not be checked.

||:

The || operator takes two boolean expressions as operands and creates a boolean expression that is true when either of the subexpressions is true

3)Answer:

bool

The bool keyword is an alias of System.Boolean. It is used to declare variables to store the Boolean values, true and false. In C# , there is no conversion between the bool type and other types

int

int variables are stored signed 32 bit integer values in the range of -2,147,483,648 to +2,147,483,647

decimal

The decimal keyword denotes a 128-bit data type.The approximate range and precision for the decimal type are -1.0 X 10-28 to 7.9 X 1028

string

The string type represents a string of Unicode characters. string variables are stored any number of alphabetic,

numerical, and special characters

5)Answer:

TryParse. A useful method for parsing integers is the int.TryParse method. The parsing logic in TryParse is the same. But the way we call it is different