Header Ads Widget

Responsive Advertisement

Question To Program Qbasic coding part -14

 



 To complete the calculation of the average mark of 4 subjects in the final examination, percentage (out of 100) of the average mark, and the Grade of Final Exam for students. If the percentage is less than 40 then Grade would be 0, for a percentage less than 50 Grade 1.00, for a percentage less than 65 Grade 2.00, for a percentage less than 80 Grade 3.00&for percentage more than or equal 80 Grade would be 4.00. In the output screen, you should display the name of students, the percentage of the average mark, and the grade. The average grade of all students should be shown at the bottom of the output screen. The data statements given below will be used to check the program whether the program gives the required output. The mark of every subject in data statements is given out of 40. The line DATA “End”, 0,0, 0, 0 is used to indicate the end of the data statement.

DATA "Abir",22, 28, 36, 26

DATA "Sourov",34, 35, 27, 37

DATA "Pranto",12, 14, 19, 29

DATA "End", 0, 0, 0, 0

            Required output

          Abir     70            3.00

          Sourov    83.13     4.00

          Pranto     46.25     1.00

          Average Grade

          2.67

 

Read n$, m1, m2, m3, m4

While n$ <> "end"

    m5 = (m1 + m2 + m3 + m4) / 4

    m6 = (m5 * 100) / 40


    If m6 < 40 Then

        h = 0

        h1 = h

    Else If m6 < 50 Then

            h = 1.00

            h2 = h

        Else If m6 < 65 Then

                h = 2.00

                h3 = h

            Else If m6 < 80 Then

                    h = 3.00

                    h4 = h

                Else

                    h = 4.00

                    h5 = h

                End If

            End If

        End If

    End If

    Print n$, m6, h

    Read n$, m1, m2, m3, m4

Wend

Print "Average Grade"

Print (h1 + h2 + h3 + h4 + h5) / 3


Data "Abir",22,28,36,26

Data "sourov",34,35,27,37

Data "pranto",12,14,19,29

Data "end",0,0,0,0







Post a Comment

0 Comments