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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:15:45+00:00 2026-05-16T18:15:45+00:00

I am new to programming so I apologize beforehand. I am running a program

  • 0

I am new to programming so I apologize beforehand. I am running a program and am having a problem with the System.out.printf method in Java. I know everything else in the program is working correctly (tested it). However this does not seem to work.

The error is:

Exception in thread “main” java.util.IllegalFormatConversionException: d != java.lang.Double
at java.util.Formatter$FormatSpecifier.failConversion(Unknown Source)
at java.util.Formatter$FormatSpecifier.printInteger(Unknown Source)
at java.util.Formatter$FormatSpecifier.print(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.io.PrintStream.format(Unknown Source)
at java.io.PrintStream.printf(Unknown Source)
at Advisor_Score.main(Advisor_Score.java:17)

My code is:

import java.lang.Math;
public class Advisor_Score {
    public static void main(String[] args){ 
        double l[] = {101,1,1,1};
        double k[] = {102,2,2,4};
        double m[] = {103,5,5,5,5,5,5,5};
        double All_users[][]={l,k,m};
        double sum[]=new double [All_users.length];
        double [] raw_advisor=new double [All_users.length];
        double []advisor_score= new double [All_users.length];
        for (int i=0;i<All_users.length;i++){
                for(int j=1;j<All_users[i].length;j++){
                        sum[i]+=All_users[i][j];
                }
                raw_advisor[i]=((sum[i]-(3*(All_users[i].length-1)))/4);
                advisor_score[i]= 2.5+(2.5*(1-Math.pow(Math.E, -.5*raw_advisor[i])));
                System.out.printf("%d: %d\n", All_users[i][0], advisor_score[i]);
                }       
    }
}

Not really sure why it’s not working.

  • 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-16T18:15:45+00:00Added an answer on May 16, 2026 at 6:15 pm

    %d represents an integer; you want to use %f for a double. See the formatting string syntax in the Javadoc

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

Sidebar

Related Questions

I apologize but I am new to programming and I'm having difficulty coding a
I am very new to programming, so I apologize if this question seems absurdly
I'm very new to programming so I apologize in advance if my question is
Programming is so new to me that I apologize for not knowing how to
I'm new to programming and apologize up front if I misuse terminology. In a
I'm new to web programming - I apologize for any unclear or incorrectly used
I am new to programming so I don't know what the terminology is and
I'm fairly new to Objective-C and iPhone programming so I apologize if this is
I am very new to Bluetooth programming, and thus I apologize if this question
( Hi, everyone. I'm very new to Windows programming, so I apologize in advance

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.