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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:16:39+00:00 2026-06-16T18:16:39+00:00

Sorry, I am new to coding and I can’t figure this out after trying

  • 0

Sorry, I am new to coding and I can’t figure this out after trying everything! I have 6 masked text boxes which the user inputs decibel values, is supposed to save them to a list, input each into a formula and output a summed decibel value, but it is simply taking the variable added as 6, which is the count of the list instead of the actual values. When I tried a foreach loop, it made it an infinite loop.

private void dBAddButton_Click(object sender, EventArgs e)
    {         
        List<double> addDBList = new List<double>();
        double final;
        double added = 0;

        addDBList.Add(double.Parse((dB1.Text)));
        addDBList.Add(double.Parse((dB2.Text)));
        addDBList.Add(double.Parse((dB3.Text)));
        addDBList.Add(double.Parse((dB4.Text)));
        addDBList.Add(double.Parse((dB5.Text)));
        addDBList.Add(double.Parse((dB6.Text))); 

            for (int i = 0; i < addDBList.Count; i++)
           {
            added += Math.Pow(10, (i / 10));
           }

        final = 10 * Math.Log10(added);

        totaldB.Text = final.ToString();                  
    }

}

The formula is basically 10log[10^(first value/10)+10^(second value/10)...+10^(nth value/10)]

  • 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-16T18:16:41+00:00Added an answer on June 16, 2026 at 6:16 pm
    added += Math.Pow(10, (i / 10));
    

    This is your problem. i is the index position of the array, not the actual value. You want to use this:

    added += Math.Pow(10, (addDBList[i] / 10));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry, but I'm new to accessing return from another domain. I have this url
Sorry, I'm new to flash I have this line of code: BaseEntry( _entryList[i] ).topTeamName
Sorry I am very new to open graph and have been having difficulty to
I'm new to this topic so sorry if this is a stupid question :\
new to this site so sorry if this question is inappropriate, or in the
Sorry, I am still new to Django, hopefully the question isn't out of place.
I am new to javascript so sorry I don't know very much. I have
New with Android. Sorry! I'm trying to create the following... Wait for Timer to
I have the following python modules. Sorry if the code is ugly. This is
Sorry for asking very simple question.I'm new to coding. Input txt file 5,3 001

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.