Ask Question
21 September, 20:49

Design a GUI program to find the weighted average of four test scores. The four test scores and their respective weights are given in the following format: testscore1 weight1 ... For example, the sample data is as follows: 75 0.20 95 0.35 85 0.15 65 0.30 The user is supposed to enter the data and press a Calculate button. The program must display the weighted average.

+4
Answers (1)
  1. 21 September, 23:26
    0
    I am writing partial code in c+ + to calculate weighted average. The weighted average should be calculated based on multiplying the test score and its respective weight and finally add all the test score.

    Explanation:

    int arrtestscore[100];

    int arrweight[100];

    int n;

    double weightedavg;

    cout<<"Enter the number of test score for which weighted average needs to be calculated";

    cin>>n;

    for (int x = 0; x
    {

    cout<<"Enter test score : " + (x+1);

    cin>>arrtestscore[x];

    count<<"Enter the respective weight:";

    cin>>arrweight[x];

    }

    for (int i=0; i
    {

    weightedavg = weightedavg + (arrtestscore[i] * arrweight[i])

    }

    cout<<"weighted average = " <
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Design a GUI program to find the weighted average of four test scores. The four test scores and their respective weights are given in the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers