I NEED A BASIC JAVA PROGRAM USING ARRAY TO FIND THE AVERAGE FOR 10 STUDENTS. THEN THERE SHOULD BE A COUNTER FOR STUDENTS AND AN ACCUMULATOR FOR THE AVERAGE AND INPUT VALIDATION FOR THE THREE TEST SCORES; THEY MUST BE BETWEEN 0 TO 100. ALSO THE AVERAGE AND AVERAGE ACCUMULATOR SHOULD BE FORMATTED TO TWO DECIMAL PLACES AND AT THE END ALL 10 STUDENTS SHOULD BE IN A KIND OF A TABLE SHOWING FIRST NAME, MIDDLE INITIAL, LAST NAME TEST 1 TEST 2 TEST 3 AND AVERAGE...…. THANKS IN ADVANCE
/***********************************Student.java***************************/
package student;
public class Student {
private String firstName;
private String middleName;
private String lastName;
private int score1;
private int score2;
private int score3;
public Student(String firstName, String middleName,
String lastName, int score1, int score2, int score3) {
super();
this.firstName = firstName;
this.middleName = middleName;
this.lastName = lastName;
if (score1 > 0 && score1
<= 100)
this.score1 =
score1;
if (score2 > 0 && score2
<= 100)
this.score2 =
score2;
if (score3 > 0 && score3
<= 100)
this.score3 =
score3;
}
public String getFirstName() {
return firstName;
}
public String getMiddleName() {
return middleName;
}
public String getLastName() {
return lastName;
}
public int getScore1() {
return score1;
}
public int getScore2() {
return score2;
}
public int getScore3() {
return score3;
}
public double getAverage() {
return ((double) (score1 +
score2 + score3)) / 3;
}
@Override
public String toString() {
String s = "";
s +=
String.format("%10s%10s%10s%10d%10d%10d%10.2f", firstName,
middleName.toUpperCase().charAt(0) + ".",
lastName, score1, score2, score3,
getAverage());
return s;
}
}
/*****************************TestStudent.java*****************************/
package student;
public class TestStudent {
public static void main(String[] args) {
Student[] students = new Student[10];
students[0] = new
Student("Jugal", "Kishor", "Saini", 90, 98, 97);
students[1] = new Student("Manoj",
"Kumar", "Saini", 90, 98, 97);
students[2] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[3] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[4] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[5] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[6] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[7] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[8] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
students[9] = new Student("Jugal",
"Kishor", "Saini", 90, 98, 97);
System.out.printf("%10s%10s%9s%13s%10s%10s%10s\n", "First",
"Middle", "Last", "Score1", "Score2", "Score3",
"Average");
;
for (Student student : students)
{
System.out.println(student.toString());
}
}
}
/*********************output**********************/
First Middle Last Score1 Score2 Score3 Average
Jugal K. Saini 90 98 97 95.00
Manoj K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00
Jugal K. Saini 90 98 97 95.00

Please change the information of student according to you to see the different output....
Please let me know if you have any doubt or modify the answer, Thanks :)
I NEED A BASIC JAVA PROGRAM USING ARRAY TO FIND THE AVERAGE FOR 10 STUDENTS. THEN...
java programming write a program with arrays to ask the first name, middle initial, last name and id# and 3 test scores of 10 students. calculate the average of the 3 test scores. show the highest class average and the lowest class average. also show the average of the whole class. please use basic codes and arrays with loops please use printf to format output sample output First name MI Last name ID# Test1 Test2 Test 3...
Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...
(JAVA) Write a program that maintains student test scores in a two-dimesnional array, with the students identified by rows and test scores identified by columns. Ask the user for the number of students and for the number of tests (which will be the size of the two-dimensional array). Populate the array with user input (with numbers in {0, 100} for test scores). Assume that a score >= 60 is a pass for the below. Then, write methods for: Computing the...
Consider the following program that reads students’ test scores into an array and prints the contents of the array. You will add more functions to the program. The instructions are given below. For each of the following exercises, write a function and make the appropriate function call in main.Comments are to be added in the program. 1. Write a void function to find the average test score for each student and store in an array studentAvgs. void AverageScores( const int scores[][MAX_TESTS], int...
Using basic c++ write 2 separate codes for this assignment. Program #1 Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions. • void getScore() should ask the user for a test score, store it in the reference parameter variable, and validate it. This function should be called by the main once for each of the five scores to be entered. •...
Having a bit of trouble in my c++ class, was wondering if anyone can help.Write a program to calculate students' average test scores and their grades. You may assume the following input data:Johnson 85 83 77 91 76Aniston 80 90 95 93 48Cooper 78 81 11 90 73Gupta 92 83 30 68 87Blair 23 45 96 38 59Clark 60 85 45 39 67Kennedy 77 31 52 74 83Bronson 93 94 89 77 97Sunny 79 85 28 93 82Smith 85 72...
C++ Write a program that reads students’ names followed by their test scores from the given input file. The program should output to a file, output.txt, each student’s name followed by the test scores and the relevant grade. Student data should be stored in a struct variable of type StudentType, which has four components: studentFName and studentLName of type string, testScore of type int and grade of type char. Suppose that the class has 20 students. Use an array of...
[JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and methods must be used for this program. Process: •Read the number of students in a class. Make sure that the user enters 1 or more students. •Create an array with the number of students entered by the user. •Then, read the name and the test score for each student. •Calculate the best or highest score. •Then, Calculate letter grades based on the following criteria:...
Write a C++ program that dynamically allocates an array large enough to hold a user-defined number of test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the sorted list of scores and averages with appropriate headings. Use pointer notation rather than array notation whenever possible. Input Validation: Do not accept negative numbers for...
this is a java course class.
Please, I need full an accurate answer. Labeled steps of the
solution that comply in addition to the question's parts {A and B},
also comply with:
(Create another file to test the class and output to the screen,
not an output file)
please, DO NOT COPY others' solutions. I need a real worked
answer that works when I try it on my computer.
Thanks in advance.
Write the definition of the class Tests such...