Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7793887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:37:49+00:00 2026-06-01T22:37:49+00:00

I have an array of test grades for each student in a class. As

  • 0

I have an array of test grades for each student in a class. As an example, for Adam test1=90 test2=92 test3=93, so the average would be 91.67. I would then save this as Array6. Then using that array, I would take 30% of that plus 70% of the final (array5) to make new array courseaverage.

I have tried to implement this in my code below, but it doesn’t work correctly. Could anyone please suggest the problem…

public class Proj5 {
    public static void main (String[] args) {        
        String[] Array1 = {new String ("Adam"),new String ("Smith"),new String ("Jones"),new String ("Becky"),new String ("Taylor")};       
        Integer[] Array2 = {new Integer(90),new Integer(89),new Integer(86),new Integer(76),new Integer(95)};        
        Integer[] Array3 = {new Integer(92),new Integer(79),new Integer(85),new Integer(90),new Integer(87)};
        Integer[] Array4 = {new Integer(93),new Integer(80),new Integer(90),new Integer(87),new Integer(92)};
        Integer[] Array5 = {new Integer(90),new Integer(77),new Integer(86),new Integer(92),new Integer(89)};

        System.out.println("Name Test1 Test2 Test3 Final Average Grade");

        for (int column = 0; column<Array1.length; column++){
            System.out.printf("%s ", Array1[column]);
            System.out.printf("%s   ", Array2[column]);
            System.out.printf("%s    ", Array3[column]);
            System.out.printf("%s    ", Array4[column]);
            System.out.printf("%s  ", Array5[column]);
            System.out.println(); //start new line of output
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:37:51+00:00Added an answer on June 1, 2026 at 10:37 pm

    An array does not have a get() method but an ArrayList does so if you change your arrays to ArrayLists then you can use get() to retrieve the value.

    If I understand correctly you have an array that holds the names of each student and each student’s grades are held in a seperate array for each student?

    String[] students= {"Adam","Smith","Jones"}; 
    int[] adamGrades = {90,92,93};
    double gradesTotal = 0.00;
    for(int i=0; i < adamGrades.length; i++){
      gradesTotal += adamGrades[i];
    }
    double avg = (gradesTotal/adamGrades.length);
    System.out.print(avg);
    

    That would give you the average for “Adam” and you should be able to use that to figure out the rest of your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this array $arr = array('test1', 'test', 'test3', 'var1', 'var5', 'var'); and I
I have an array @test . What's the best way to check if each
I have an array that looks like: $fields = array( f1 => array(test), f2
Let's say I have an array var test = new Array() the values in
I have this array $test = $_POST['test']; print_r($test); Array ( [0] => Array (
i have an array, which includes some pages: var pages = ['test', 'blabla', 'xyz'];
I have a PHP array, and I need to test the content of that
I have a string like this: TEST.DATA.Data.COR.Point,2;TEST.DATA.Data.COR.Point,5;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.WordTOFIND,18 I have a list of array with
I have two arrays: $array1 = array(1=>1,10=>1,12=>0,13=>13); $array2 = array(1=>Hello,10=>Test,12=>check,13=>error); Here $array1 has keys
I have an array of arrays. For example: $array[] = array(1, 2, 3); $array[]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.