// This pseudo-code when "executed" will calculate the weighted test average for this course. // It is written in Java-like code. int test1Score; int test2Score; int finalScore; int tempWeightedScore; int sumWeights; int sumWeightedScores; float weightedAvg; test1Score <- INPUT; test2Score <- INPUT; finalScore <- INPUT; sumWeightedScores = 15 * test1Score; weightedScore = 15 * test2Score; sumWeightedScores = sumWeightedScores + weightedScore; weightedScore = 25 * finalScore; sumWeightedScores = sumWeightedScores + weightedScore; sumWeights = 15 + 15 + 25; weightedAvg = sumWeightedScores / sumWeights; OUTPUT <- ("The weighted test average is " + weightedAvg + "."); // This code replaces the literal embedded in the code with constant values. The constants // as well as all variables are defined at the top of the program as a directory or reference // for the values. final int WEIGHT_TEST1 = 15; final int WEIGHT_TEST2 = 15; final int WEIGHT_FINAL = 25; int test1Score; int test2Score; int finalScore; int tempWeightedScore; int sumWeights; int sumWeightedScores; float weightedAvg; test1Score <- INPUT; test2Score <- INPUT; finalScore <- INPUT; sumWeightedScores = WEIGHT_TEST1 * test1Score; tempWeightedScore = WEIGHT_TEST2 * test2Score; sumWeightedScores = sumWeightedScores + tempWeightedScore; tempWeightedScore = WEIGHT_FINAL * finalScore; sumWeightedScores = sumWeightedScores + tempWeightedScore; sumWeights = WEIGHT_TEST1 + WEIGHT_TEST1 + WEIGHT_TEST1; weightedAvg = sumWeightedScores / sumWeights; OUTPUT <- ("The weighted test average is " + weightedAvg + ".");