A student's class average can be computed by dividing the number of points they have earned by the number of points possible in the class. Assume the following variables have been declared as shown and given values elsewhere:
Int pointsEarned, pointsPossible;
Double classPercentage;
Which of the following statements will assign the correct percentage average to classPercentage? For example, if pointsEarned is 725 and pointsPossible is 1000, classPercentage should be assigned the value 72.5.
A) classPercentage = pointsEarned/pointsPossible * 100.0;
B) classPercentage = 100 * pointsEarned/pointsPossible;
C) classPercentage = (100.0 * pointsEarned) /pointsPossible;
D) classPercentage = (100.0 + pointsEarned) /pointsPossible;
Correct Answer:
Verified
Q23: What is the value of the following
Q50: What is the value of the following
Q88: Which of the following statements places input
Q92: What will be printed by the statement
Q108: Assuming that the user inputs a value
Q109: What are the values of num1 and
Q110: Assume the following variables have been declared
Q114: What will be printed by the statements
Q115: Assume the following variables have been declared
Q116: Which one of the following is a
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents