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 1056659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:44:50+00:00 2026-05-16T17:44:50+00:00

So I want to start and say I am new to Java programming. Here

  • 0

So I want to start and say I am new to Java programming. Here is my problem. I want to create a program that in essence cycles through an array of arrays. The arrays need to be variable lengths.

My first step is I start out with array of scores. Each array is connected to a specific users. These arrays will be of differing lengths depending on the user.

My second step is to group these user arrays into a larger array with the individual arguments being the user arrays from step 1. This array should be variable length, depending on the number of users.

My final step, is to run this larger array through a series of mathematical operations. I knwo how to create the calculations. This is a main method doing the calculations

import java.lang.Math;

public class Advisor_Score {
    public static void main(String[] args)
    {


        double review_sum[]={5,5,5,5,5,5,5,5,5,5};
        //Every time a user answers a question, they will be rated. This is the array holds these ratings.
        //A given user will have ten advisor scores, one for each category.
        double sum = 0;
        {   

            for(int x=0;x<review_sum.length;x++)
                //All scores less than 0 or more than 5 are thrown out
            {
                if (review_sum[x]<0 || review_sum[x]>5)
            {
                    sum+=0;
            }
                else
                    sum+=review_sum[x];
            }
        double raw_advisor=(sum-(3*review_sum.length))/4;
        System.out.println(raw_advisor);
        double advisor_score_scaled= 2.5*(1-Math.pow(Math.E, -.5*raw_advisor));
        double advisor_score = 2.5 + advisor_score_scaled;
        System.out.println(advisor_score);
        }
    }
}

Eventually I want to loop through the larger array, running each argument in the larger array through this set of computations. I am not wedded to arrays, as I have been told that list might work better. I am just unschooled as to how to use lists. Thanks in advance!

  • 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-05-16T17:44:51+00:00Added an answer on May 16, 2026 at 5:44 pm

    If I’m reading your question right, it looks like you want to map a user-name to a list of scores. You can do something like this (this example is contrived, and so values are hardcoded):

    Map<String, List<Integer>> userScores = new LinkedHashMap<String, List<Integer>>();
    
    String user1 = "Bob";
    List scores1 = new ArrayList<Integer>();
    scores1.add(5);
    scores1.add(10);
    scores1.add(15);
    
    userScores.put(user1, scores1);
    
    ...
    ...
    
    String user4 = "Rob";
    List scores4 = new ArrayList<Integer>();
    scores4.add(2);
    scores4.add(3);
    scores4.add(4);
    
    userScores.put(user4, scores4);
    

    Then you can iterate over the map like this and access the users and their scores:

    for(Map.Entry<String, List<Integer>> entry : userScores.entrySet()) {
       String user = entry.getKey();
       List<Integer> scores = entry.getValue();
    
       //to iterate over the list of scores
       for(int score : scores) {
           ...
       }   
    }
    

    To answer your general question about an array of arrays, you can have a list of lists like this:

    List<List<Integer> listOfLists = new ArrayList<List<Integer>>();
    

    So you’d create lists and add them to your list of lists like this:

    List<Integer> list1 = new ArrayList<Integer>();
    list1.add(1);
    list1.add(2);
    list1.add(3);
    
    listOfLists.add(list1);
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To start off, let me say that i'm ignorant of both Java, JSP and
in linux, let say i want to start tomcat, and want to direct all
I want to start a calculation task that will last for a couple of
I want to start a background process in a Java EE (OC4J 10) environment.
Say I want to start with a blank JavaScript object: me = {}; And
to start with i want to say this is no homework or somthing, i
I'm trying to pick a web framework that is Java based to start a
Here's my problem, I'm using the following java code using JMF for playing video.
Let's say you want to start contributing to an open source project with thousands
I am new to cookies management. I just want to start with a simple

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.