Write a Java program that uses six grades as integer values and calculate their average. Result must be printed as a floating data type. Design your program using the following specifications.
1. You must declare integer variables to hold the grades. Assume grades are always integer.
2. Result must be stored in a separate variable.
3. All numbers in the output must be in floating data type.
4. All grades must be displayed in one significant digit floating number.
5. Class average must be displayed in two significant digit floating number.

public class AverageGrade {
public static void main(String[] args) {
int first = 90, second = 85, third = 97, fourth = 99, fifth = 51, sixth = 71;
float avg = (float) ((first + second + third + fourth + fifth + sixth) / 6.0);
System.out.printf(" The first number is:\t%.1f\n", (float)first);
System.out.printf(" The second number is:\t%.1f\n", (float)second);
System.out.printf(" The third number is:\t%.1f\n", (float)third);
System.out.printf(" The fourth number is:\t%.1f\n", (float)fourth);
System.out.printf(" The fifth number is:\t%.1f\n", (float)fifth);
System.out.printf(" The sixth number is:\t%.1f\n", (float)sixth);
System.out.println("--------------------------------");
System.out.printf(" The class average is:\t%.2f\n", avg);
}
}

Write a Java program that uses six grades as integer values and calculate their average. Result...
Write a Java program that inputs a list of integer values in the range of − 1 to 100 from the keyboard and computes the sum of the squares of the input values. This program must use exception handling to ensure that the input values are in range and are legal integers, to handle the error of the sum of the squares becoming larger than a standard Integer variable can store, and to detect end-of-file and use it to cause...
Using Java, write a program that teachers can use to enter and calculate grades of individual students by utilizing an array, Scanner object, casting, and the print method. First, let the user choose the size for the integer array by using a Scanner object. The integer array will hold individual assignment grades of a fictional student. Next, use a loop to populate the integer array with individual grades. Make sure each individual grade entered by the user fills just one...
Copy the program DigitPlay.java and implement the TBI (To Be Implemented) method named play(Result r). Your program cannot contain any import statements. Your play(Result r) method cannot call any other methods. The output of your program must match the following. number: 5 # of digits: 1 smallest digit: 5 largest digit: 5 digit range: 0 digit sum: 5 digit average: 5.0 digit product: 5 number: 42 # of digits: 2 smallest digit: 2 largest digit: 4 digit range: 2 digit...
Task 4: Integer and Floating Point Division Open Division.java and write code to solve the following problem: 1. prompts for and reads in an integer (on the same line) 2. Outputs: i) the value of the number divided by 100 as a floating point value ii) the remainder when the number is divided by 100 iii) the number of times 100 divides the integer iv) outputs the digits of the integer in reverse order; i.e., each digit must be extracted...
Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...
Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...
Write a java program that uses a loop to input, from the user not using gui, a collection of values that are the number of steps taken each day for a sequence of days and stores those amounts in an array. the array length should be 31, The user is not required to enter 31 values. the program determines and displays the largest number of steps for a single day, the smallest number of steps for a single day and...
Write a java program for the following: Your program reads an infix expression represented by a string S from the standard input (the keyboard). Then your program converts the infix expression into a postfix expression P using the algorithm. Next, your program evaluates the postfix expression P to produce a single result R. At last, your program displays the original infix expression S, the corresponding postfix expression P and the final result R on the standard output ( the screen...
This is a Java program Write a program that reads an unspecified number of integers, determines home many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number to 2 decimal places. System.out.println(countPositive); System.out.println(countNegative); System.out.println(total); System.out.printf("%.2f",total * 1.0 / count); Assume inputs are always integer [-912985158, 912985158] and ends with 0. Input 1 2 -1 3...
use JOptionPane to display output Can someone please help write a program in Java using loops, not HashMap Test 1 Grades After the class complete the first exam, I saved all of the grades in a text file called test1.txt. Your job is to do some analysis on the grades for me. Input: There will not be any input for this program. This is called a batch program because there will be no user interaction other than to run the program....