A student's class average can be computed by dividing the number of marks they have earned by the number of marks possible.Assume the following variables have been declared as shown and given values elsewhere:
int marksEarned, marksPossible;
double classPercentage;
Which of the following statements will assign the correct percentage average to classPercentage? For example, if marksEarned is 725 and marksPossible is 1000, classPercentage should be assigned the value 72.5.
A) classPercentage = marksEarned / marksPossible * 100.0;
B) classPercentage = 100 * marksEarned / marksPossible;
C) classPercentage = (100.0 * marksEarned) / marksPossible;
D) classPercentage = (100.0 + marksEarned) / marksPossible;
Correct Answer:
Verified
Q74: What is the value of Math.pow(2, 3)?
A)5.0
B)6.0
C)8.0
D)9.0
Q75: Which is the mathematical equivalent of the
Q76: Which of the following is the Java
Q77: What is result of evaluating the following
Q78: What is the value of the following
Q80: Which is a correct representation of the
Q81: What will be printed by the statements
Q82: Assume the following variable has been declared
Q83: What will be printed by the statements
Q84: What does the following statement sequence print
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