Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# visual studio. don't need to do full programs just the statements is enough -----Assume that strName1 and strName2 are variables of type string and

C# visual studio. don't need to do full programs just the statements is enough

-----Assume that strName1 and strName2 are variables of type string and lblResult is a label. Write instructions to do each of the following.

Remove all leading and trailing blanks from strName1.

If strName1 and strName2 are equal, assign the word equal to lblResult.

If strName1 and strName2 are equal (ignoring differences in upper and lower case), assign the word equal when ignoring case to lblResult.

If strName1 is less than strName2, assign the words less than to lblResult.

if strName1 is greater than strName2, assign the words greater than to lblResult.

------Assume that dblAmount is a variable of type double and txtAmount is a text box. Write instructions that will use a TryParse to convert the contents of txtAmount into a double and store it into dblAmount. If this cannot be done display a message box saying Invalid data, select the contents of txtAmount, set the focus to txtAmount, and exit the current event-procedure.

Want are radio buttons? What are check boxes? How are they different?

What is the CheckChanged event for a check box?

-----Write a set if if statements which will look at a character variable named letterGrade and assign a value to pointValue as follows:

A is worth 4

B is worth 3

C is worth 2

D is worth 1

All others are worth 0

Rewrite problem 9 to use a switch statement.

------What is a listBox control? Explain each of the following properties:

.Items collection

.Items(n) for some integer n

.Items.Count

.SelectedIndex

.SelectedItem

.Sorted

--------Assume that the program has radio buttons named radSmall, radMedium, and radLarge. Assign a value to the variable decPrice depending on which one of the three buttons is checked. The values are 5.55 for radSmall, 7.25 for radMedium, and 9.95 for radLarge.

The values defined for the type dialogResult are:

DialogResult.Abort

DialogResult.Cancel

DialogResult.Ignore

DialogResult.No

DialogResult.None

DialogResult.OK

DialogResult.Retry

DialogResult.Yes

Consider the instructions:

DialogResult reply;

reply = MessageBox.Show("Really Quit", "Verify", MessageBoxButtons.YesNoCancel);

---Write instructions that will check the value of reply and close the form if the Yes button was clicked.

-----Write if statements to do each of the following.

Consider the variable named PointsEarned. If it has a value greater than or equal to 90, then assign the letter A to the variable LetterGrade. If it has a value less than 90 and greater than or equal to 80, then assign the letter B to the variable LetterGrade. If it has a value less than 80 and greater than or equal to 70, then assign the letter C to the variable LetterGrade. If it has a value less than 70 and greater than or equal to 60, then assign the letter D to the variable LetterGrade. Otherwise, assign the letter F to LetterGrade.

If the value of variable strVote is Yes or yes then add 1 to intYesVotes. But, if the value of variable strVote is No or no then add 1 to intNoVotes. In all other cases, add 1 to intInvalidVotes. (YES would be invalid in this case.)

If the value of variable intTemperature is over 85 then set strWeather to Hot. But if the value of intTemperature is between 70 and 85, then set strWeather to Warm. When intTemperature is between 55 and 69, set strWeather to Cool. Otherwise, set strWeather to Cold.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago

Question

Recognize the four core purposes service environments fulfill.

Answered: 1 week ago