Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions relate to Visual C# What is a listBox control? Explain each of the following properties: .Items collection .Items(n) for some integer n .Items.Count .SelectedIndex

Questions relate to Visual C#

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

    1. .Items collection

    2. .Items(n) for some integer n

    3. .Items.Count

    4. .SelectedIndex

    5. .SelectedItem

    6. .Sorted

  2. Explain the use of each of the following methods for a listBox.

    1. .Add(Dave)

    2. .Remove(Dave)

    3. .Insert(0, New Item)

    4. .RemoveAt(0)

    5. .Clear

    6. .Items.Contains(Dave)

    7. .Items.IndexOf(Dave)

  3. 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.

  4. Assume that the program has check boxes named chkMushrooms, chkHamburger, and chkpepperoni. Add 1.25 to the variable decPrice for each of these check boxes that is checked.

  5. Display a message box with the message Is that correct?, the title Thank You and the button Messageboxbuttons.YesNo. The value returned should be stored in a variable named buttonClicked (with is of type DialogResult).

  6. 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.

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

    1. 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.

    2. 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.)

    3. 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

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

Define a derivative instrument as per U.S. GAAP and as per IFRS.

Answered: 1 week ago

Question

i need 2 1 7 .

Answered: 1 week ago

Question

2. What are the different types of networks?

Answered: 1 week ago