1 / 15

Test-Driving the Class Average Application

Test-Driving the Class Average Application. Test-Driving the Class Average Application. Entering grades in the Class Average application. Entering quiz grades Enter a grade into the Enter grade: TextBox Click Add Grade Button Grade added to ListBox Focus given to TextBox.

Télécharger la présentation

Test-Driving the Class Average Application

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Test-Driving the Class Average Application

  2. Test-Driving the Class Average Application Entering grades in the Class Average application. • Entering quiz grades • Enter a grade into the Enter grade:TextBox • Click Add Grade Button • Grade added to ListBox • Focus given to TextBox

  3. Label displaying average Click to calculate class average Test-Driving the Class Average Application Displaying the class average. • Calculating the average • Click the AverageButton • Average displayed in output Label • Add GradeButton enabled

  4. Test-Driving the Class Average Application Entering a new set of grades. • Entering another set of grades • Old quiz grades removed from ListBox • New grade added to ListBox

  5. do…while Repetition Statement • do…while example: • int intCounter = 1;do{ lstDisplay.Items.Add( intCounter ) intCounter++;} while ( intCounter <= 2 ); • Set counter to 1 • Execute body of do…while statement while the counter is less than or equal to 2

  6. Creating the Class Average Application ClassAverage application’s Form in design view. • Template application • Contains: • ListBox • Buttons • Output Label

  7. Clearing the grade list and class average Creating the Class Average Application Clearing the ListBox and output Label after a calculation. • Clearing ListBox and output Label • If output Label contains text • Clear output Label of previous result • Clear ListBox of previous quiz grades

  8. Adding a numeric grade to the ListBox and clearing the user input from the TextBox Creating the Class Average Application Adding the grade input to the ListBox and clearing the Enter grade: textBox. • Displaying grades • Add grade to ListBox • Clear TextBoxtxtInput

  9. Transferring the focus of the application to theTextBox Creating the Class Average Application Transferring the focus to the TextBox control. • Transferring focus to a control • Makes application easier to use • Use method Focus of that control

  10. ClassAverage.cs(1 of 6)

  11. ClassAverage.cs(2 of 6)

  12. ClassAverage.cs(3 of 6)

  13. Disabling theAddGradeButtonand transferring the focus to the AverageButton Using the Focus method ClassAverage.cs(4 of 6)

  14. Using a do…while statement to calculate the class average Enabling theAddGradeButtonand transferring the focus to the Enter grade:TextBox ClassAverage.cs(5 of 6)

  15. ClassAverage.cs(6 of 6)

More Related