![jojojolie8570](/avatars/25012.jpg)
jojojolie8570
04.03.2021 •
Computers and Technology
Which of the following is used to keep track of website content?
Solved
Show answers
More tips
- C Computers and Internet Are there special gaming mice?...
- L Leisure and Entertainment When will Maslenitsa start?...
- F Food and Cooking Discovering the Mysterious Fruit of Feijoa...
- B Business and Finance How to Open an Online Store? A Detailed Guide for Beginners...
- W Work and Career How to Write a Resume That Catches the Employer s Attention?...
- C Computers and Internet Е-head: How it Simplifies Life for Users?...
- F Family and Home How to Choose the Best Diapers for Your Baby?...
- F Family and Home Parquet or laminate, which is better?...
- L Leisure and Entertainment How to Properly Wind Fishing Line onto a Reel?...
- L Leisure and Entertainment How to Make a Paper Boat in Simple Steps...
Ответ:
your search history is one way to keep track of it
Ответ:
// Scanner class is imported so that the program can can user input
import java.util.Scanner;
// class Solution is defined
public class Solution {
//main method which begin program execution is defined
public static void main(String args[]) {
// Scanner object scan is defined to receive input fromkeyboard
Scanner scan = new Scanner(System.in);
// A prompt is display to the user asking for number of grade
System.out.println("How many grade do you want to enter");
// The user input is assigned to numOfGrade
int numOfGrade = scan.nextInt();
// An array of integer called gradeArray is declared
// it has numOfGrade as length
int[] gradeArray = new int[numOfGrade];
// for-loop that prompt the user to enter grade to fill the gradeArray
for(int i = 0; i < numOfGrade; i++){
System.out.println("Enter a grade: ");
int grade = scan.nextInt();
gradeArray[i] = grade;
}
// sun variable is declared and initialized to 0
int sum = 0;
// numOfFail is declared and initialized to 0
int numOfFail = 0;
// for-loop through the gradeArray that add all element
// it also increase the counter for numOfFail if grade is < 70
for(int j = 0; j < gradeArray.length; j++){
sum += gradeArray[j];
if (gradeArray[j] < 70){
numOfFail++;
}
}
// aveargeGrade is calculated
int averageGrade = (sum / numOfGrade);
// numOfFail is displayed to the user
System.out.println("Number of fail is: " + numOfFail);
// the averageGrade is also displayed.
System.out.println("Average grade is: " + averageGrade);
}
}
Explanation:
The code is well commented and written in Java.