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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:25:57+00:00 2026-06-12T17:25:57+00:00

Please take a look at this topic : Can I calculate the average of

  • 0

Please take a look at this topic :
Can I calculate the average of these numbers?
How can I write a program for this?
In the right answer, he just wrote the equation without the java program and he used for example newValue without intialise the newValue.
Here is the equation:

int currentScore = (currentScore * currentCount + newValue) / currentCount;
  • 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-12T17:25:58+00:00Added an answer on June 12, 2026 at 5:25 pm

    Please find broken steps as below:

       private float calculateNewScore(){
            float currentScore = 6.1123
            int currentCount = 12;
            float newValue = 4.5;
            int newCount = currentCount+1;
    
            float newScore = (currentScore * currentCount + newValue) / newCount ;
    
        }
    

    If you are looking for sample program, it can be something like this:

     public class CalculateScore {
    
      public static void main(String[] args) {
        float currentScore = 6.1123; //you can initialize with any desired value
        int currentCount = 12;//you can initialize with any desired value
    
        float newValue = 0;
        Scanner scanner = new Scanner( System.in );     
    
        do{
            System.out.println("Enter your new value. Enter 0 or negative to exit.");
            newValue = scanner.nextFloat();
            if(newValue>0){
                currentScore = (currentScore*currentCount+newValue)/(++currentCount);
                System.out.println("Your new score is "+currentScore);
            }else{
                System.out.println("Program is exiting");
            }
    
        }while(newValue >0);
       }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can someone take a look at this please http://jsfiddle.net/bloodygeese/ecscY/56/ it looks like I have
Please take a look at this link: http://bethhaim.spin-demo.com/ I can't figure out why there
Please take a look at this fiddle http://jsfiddle.net/Qstuw/7/ First answer is selected by default,
Please take a look at this fiddle: http://jsfiddle.net/hughbe/QYGcq/ As you can see, the label
Please take a look at this: http://jsfiddle.net/tmPfV/ If you click right the box moves
Please take a look at this code.... what is i have instead of average,
Please take a look at this navigation: http://beta.viewcms.info/mint/ And you can see the hover
Please take a look at this example: #include <iostream> #include <vector> #include <string> using
Please take a look at this code: template<class T> class A { class base
Please take a look at this screenshot first: I would like to move the

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.