+ 1
Java assignment help nedded🙏🏻
write a program to calculate the average score tests for students and the total average of the class
9 Réponses
+ 7
You should be more specific about your issue instead of telling us your whole code project. Thought this one is short but that's a good habit to get.
+ 5
https://www.sololearn.com/Codes/
^Post what you have so far and where you're getting stuck at. I'll be more than happy to help you out with it.
+ 1
write a java program that process the marks aquired in a course for a number of students in the prgramming course ,The total number of students and their total tests in the course will be specified by the user at the beginning of the program,
The user will enter the name and grades at the beginning of the progam ,The program shoul calculate the average score for every students and also for class average.The students’ names should be stored in one-dimensional string array, a 2D array should be used for the grades.A one-dimensional array should be used for the average. it should be 5 columns with these information input :(name of student-test1-test2-test3)(-average of the tests of each student )and at the end the average of all the class in the course
+ 1
This is my code:
import java.util.Scanner;
public class TestResult {
public static void main(String[] args)
{
TestScore one;
String name;
int test1;
int test2;
int test3;
//
Scanner keyboard = new
Scanner(System.in);
System.out.print("Enter the Student's name");
name=keyboard.nextLine();
System.out.print("Enter first TestScore");
test1=keyboard.nextInt();
System.out.print("Enter Second TestScore");
test2=keyboard.nextInt();
System.out.print("Enter Third TestScore");
test3=keyboard.nextInt();
one = new TestScore (name,test1,test2,test3);
System.out.println();
System.out.println("Student " +one.getName());
System.out.println("First Score " +one.getTest1());
System.out.println("Second Score " +one.getTest2());
System.out.println("third Score " +one.getTest3());
System.out.println("High Score " +one.getHighScore());
System.out.println("Low Score " +one.getLowScore());
System.out.println("Average Score " +one.getAverage());
System.out.println("Letter Grade " +one.getLetter());
}
}
public class TestScore
{
private String name;
private int test1;
private int test2;
private int test3;
private int highScore;
private int lowScore;
private int average;
private char letter;
public TestScore(String nam,int t1,int t2,int t3, int high, int low, int average, char let)
{
// calculating these values int high, int low on average, char let
name=nam;
test1=t1;
test2=t2;
test3=t3;
+ 1
when I ran the app it calculates the average neither for the student nor for the class besides it adds only the test and name of the first students.
I could not use the array in the app it did not work!
Thanks a lot
+ 1
(You should be more specific about your issue instead of telling us your whole code project. Thought this one is short but that's a good habit to get.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks for your quick response.I wrote the whole code project just to let you know what is my project and why I am using an array in the project.I post the topic on my mobile, I will copy the code from my pc and I will explain the problem I faced.
+ 1
(https://www.sololearn.com/Codes/
^Post what you have so far and where you're getting stuck at. I'll be more than happy to help you out with it.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks a lot for your quick response.I will copy the code I wrote.
+ 1
When I run the program I got this message:
~~~~~~~~~~~~~~~~~~~~~~
run:
Enter the Student's name Sandy
Enter first TestScore 90
Enter Second TestScore 88
Enter Third TestScore 87
Exception in thread "main" java.lang.ExceptionInInitializerError
at testresult.TestResult.main(TestResult.java:47)
Caused by: java.lang.RuntimeException: Uncompilable source code - class TestScore is public, should be declared in a file named TestScore.java
at testresult.TestScore.<clinit>(TestResult.java:68)
... 1 more
Java Result: 1
BUILD SUCCESSFUL (total time: 30 seconds)