Question
Develop an application using user-interface functions (calculate grade point, grade average, and check textbox entries) (please use visual basic)
Ertu Come Home Coupe 2 Grade Port Average Calcune GPA Figure 2. Layout of the Design. User enters the Letter Grade column and
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is the solution:

code:

Public Class Form1
    'declare the grade point
    Dim A As Double = 4.0
    Dim B As Double = 3.0
    Dim C As Double = 2.0
    Dim D As Double = 1.0
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        CenterToScreen() 'center on the screen
        txtGP1.Enabled = False
        txtGP2.Enabled = False
        txtGP3.Enabled = False
        txtGP4.Enabled = False
        txtGPA.Enabled = False
        txtALL.Enabled = False
    End Sub

    Private Sub txtClear_Click(sender As Object, e As EventArgs) Handles txtClear.Click
        'clear all the textfield
        txtLG1.Clear()
        txtLG2.Clear()
        txtLG3.Clear()
        txtLG4.Clear()
        txtCH1.Clear()
        txtCH2.Clear()
        txtCH3.Clear()
        txtCH4.Clear()
        txtGP1.Clear()
        txtGP2.Clear()
        txtGP3.Clear()
        txtGP4.Clear()
        txtALL.Clear()
        txtGPA.Clear()
    End Sub

    Private Sub txtExit_Click(sender As Object, e As EventArgs) Handles txtExit.Click
        Me.Close() 'close the form
    End Sub

    Private Sub txtCalculateGPA_Click(sender As Object, e As EventArgs) Handles txtCalculateGPA.Click
        Dim CH, LGP1, LGP2, LGP3, LGP4 As Double
        Dim LG As String
        LG = txtLG1.Text 'take the input from course 1 letter grade
        CH = txtCH1.Text 'take the input from course 1 credit hours
        LGP1 = letterGrade(LG, CH) 'calculate the grade point

        LG = txtLG2.Text 'take the input from course 2 letter grade
        CH = txtCH2.Text 'take the input from course 2 credit hours
        LGP2 = letterGrade(LG, CH) 'calculate the grade point

        LG = txtLG3.Text 'take the input from course 3 letter grade
        CH = txtCH3.Text 'take the input from course 3 credit hours
        LGP3 = letterGrade(LG, CH) 'calculate the grade point

        LG = txtLG4.Text 'take the input from course 4 letter grade
        CH = txtCH4.Text 'take the input from course 4 credit hours
        LGP4 = letterGrade(LG, CH) 'calculate the grade point

        'display the gradepoint to the textbox
        txtGP1.Text = LGP1
        txtGP2.Text = LGP2
        txtGP3.Text = LGP3
        txtGP4.Text = LGP4

        Dim average As Double = (LGP1 + LGP2 + LGP3 + LGP4) / 4 'calculate the Average grade point
        txtGPA.Text = average 'display the Average grade point to the textbx

    End Sub
    'function to calculate the gradepoint
    Private Function letterGrade(lg As String, ch As Object) As Double
        Dim gradePoint As Double
        Select Case lg
            Case "A"
                gradePoint = ch * A
            Case "B"
                gradePoint = ch * B
            Case "C"
                gradePoint = ch * C
            Case "D"
                gradePoint = ch * D
        End Select
        Return gradePoint 'return the grade point
    End Function
End Class

sample output:

BP GPA Calculator - O X Enter Course Information Creadit Hours Grade Point 20 Letter Grade Course #1 A Course #2 B Course #3

Add a comment
Know the answer?
Add Answer to:
Develop an application using user-interface functions (calculate grade point, grade average, and check textbox entries) (please...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This question was answered by someone else but their code doesn't work when I try to...

    This question was answered by someone else but their code doesn't work when I try to run it. Q1. Currently, you are enrolled in the Spring semester and taking five courses. Write a program that asks the user to enter the final score of each course. The program should display a letter grade for each class, a statement based on a letter grade, and a spring semester GPA. Each course has 3 credit hours. Write the following functions in the...

  • To write a C++ program to find average of three integers using functions Objectives: To get...

    To write a C++ program to find average of three integers using functions Objectives: To get familiar with functions in C++ Task 1: Study the working of user-defined functions in C++ Task 2: To write a C++ program to find average of three integers using functions Programming Instructions: Make new project (Visual C++ Empty Project) named lab6 and add a C++ file named lab6.cpp to this project. (Some IDE may automatically generate main.cpp or source.cpp, then you just rename it...

  • 8. -/2 points ASWSBE13 3.E.016.MI. My Notes The grade point average for college students is based...

    8. -/2 points ASWSBE13 3.E.016.MI. My Notes The grade point average for college students is based on a weighted mean computation. For most colleges, the grades are given the following data value A (4), (3), (0). Alter 60 credit hours of course work, a student at State University and credit hours of A, 10 credit hours of B, 2 credit hours of C, and 4 credit hours of D. (a) Compute the student's grade point average Ask Your Teacher (2),...

  • Introducing JOptionPane. The Learning Goal for this exercise is to interact with a user with JOptionPane...

    Introducing JOptionPane. The Learning Goal for this exercise is to interact with a user with JOptionPane and use that instead of Scanner for user input and output. PowerShell or Terminal is not a standard way that users interact with programs. Windows and dialog boxes are very natural. JOptionPane will allow you to get information to and from a user. Create a Calculator that will calculate the grade in this course. _Create a Java Program that can calculate your final grade...

  • Programming Concepts cin/cout variables/types Functions Reference structs Task Summary: For this first Quest you I have...

    Programming Concepts cin/cout variables/types Functions Reference structs Task Summary: For this first Quest you I have set up a program in Visual Studio that will use operation between fractions. I have written a basic code example that does all the resources that you need to follow. Your job is to complete the exercises presented below in quest2.cpp. For this assignment you will learn and demonstrate how to: Work with functions use Past-by-Value and Past-by-Reference. use structs. use cin to get...

  • ASSIGNMENT #3 ** using System; namespace GradeCalculatorNew {    class MainClass    {        public...

    ASSIGNMENT #3 ** using System; namespace GradeCalculatorNew {    class MainClass    {        public static void Main (string[] args)        {            int test1,test2,test3;            double average,average2;            char letterGrade;            Console.WriteLine("Enter test score1");            test1=Convert.ToInt32(Console.ReadLine());            Console.WriteLine("Enter test score2");            test2=Convert.ToInt32(Console.ReadLine());            Console.WriteLine("Enter test score3");            test3=Convert.ToInt32(Console.ReadLine());            average=(test1+test2+test3)/3.0;            average=(int)(average+0.5);           ...

  • Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays,...

    Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator. Upon program execution, the screen will be cleared and the menu shown below will appear at the top of the screen and centered. The menu items are explained below. Help Smallest Quit H or h ( for Help ) option will invoke a function named help() which will display a help screen. The help screen(s) should guide the user...

  • Develop an interactive program to assist a Philosophy professor in reporting students’ grades for his PHIL-224.N1...

    Develop an interactive program to assist a Philosophy professor in reporting students’ grades for his PHIL-224.N1 to the Office of Registrar at the end of the semester. Display an introductory paragraph for the user then prompt the user to enter a student record (student ID number and five exam-scores – all on one line). The scores will be in the range of 0-100. The sentinel value of -1 will be used to mark the end of data. The instructor has...

  • In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a tes...

    In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a test grade (integer value) for each student in a class. Validation Tests are graded on a 100 point scale with a 5 point bonus question. So a valid grade should be 0 through 105, inclusive. Processing Your program should work for any...

  • Please develop the following code using C programming and using the specific functions, instructi...

    Please develop the following code using C programming and using the specific functions, instructions and format given below. Again please use the functions given especially. Also don't copy any existing solution please write your own code. This is the first part of a series of two labs (Lab 7 and Lab 8) that will complete an implementation for a board-type game called Reversi (also called Othello). The goal of this lab is to write code that sets up the input...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT