Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise, you modify one of the Course Information applications created in this chapters Apply lesson. Use Windows to make a copy of the

In this exercise, you modify one of the Course Information applications created in this chapters Apply lesson. Use Windows to make a copy of the Course Info Solution-Total Hours folder. Rename the copy Course Info Solution-GPA. Open the Course Info Solution.sln file contained in the Course Info Solution-GPA folder. Unlock the controls on the form. Then, add two labels to the form. Position both between the lblTotal and btnCalc controls. Change one of the new labels Text property to GPA:. Change the other new labels name to lblGpa. Lock the controls. Open the Code Editor window. In addition to displaying the total number of hours completed, the btnCalc_Click procedure should also display the students GPA. Grades of A, B, C, D, and F are worth 4 points, 3 points, 2 points, 1 point, and no points, respectively. Display the GPA with one decimal place. Modify the procedures code. Save the solution and then start and test the application.

image text in transcribed

Code:

Public Class frmMain Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' Display the total number of credit hours completed.

End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub

Private Sub CoursesBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles CoursesBindingNavigatorSaveItem.Click Try Me.Validate() Me.CoursesBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.MyCoursesDataSet) MessageBox.Show("Changes saved.", "Course Information", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch ex As Exception MessageBox.Show(ex.Message, "Course Information", MessageBoxButtons.OK, MessageBoxIcon.Information) End Try End Sub

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'MyCoursesDataSet.Courses' table. You can move, or remove it, as needed. Me.CoursesTableAdapter.Fill(Me.MyCoursesDataSet.Courses)

End Sub End Class

Course Information ID Code Title HoursGrade Total hours comple Calculate Exit

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