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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:23:12+00:00 2026-05-28T14:23:12+00:00

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

  • 0
 using System;
  using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
   using System.Windows.Forms;

  namespace Adaline
  {
  public partial class Form1 : Form
  {
    float d1, d2, d3, d4, eta;
    float y1, y2, y3, y4;
    float w10, w11, w12;
    float w20, w21, w22;
    float w30, w31, w32;
    float w40, w41, w42;
    float x10, x11, x12;
    float x20, x21, x22;
    float x30, x31, x32;
    float x40, x41, x42;

    float net, net1, net2, net3, net4;

    float dw10, dw11, dw12;
    float dw20, dw21, dw22;
    float dw30, dw31, dw32;
    float dw40, dw41, dw42;

        public Form1()
    {
        InitializeComponent();
    }
        public void Adaline(float x0, float x1, float x2,
                            float w0, float w1, float w2,
                            float d, float net, float y,
                            float dw0, float dw1, float dw2, float eta)
        {
            net = x0 * w0 + x1 * w1 + x2 * w2;

            if (net <= 0)
                y = 1;
            else
                y = -1;

            dw0 = eta * x0 * (d - net);
            dw1 = eta * x1 * (d - net);
            dw2 = eta * x2 * (d - net);

            string a = "{0}   {1}   {2}   {3}   {4}    {5}   {6}   {7}   {8}    {9}     {10}    {11}", x0, x1, x2, w0, w1, w2, d, net, y, dw0, dw1, dw2;
            listBox1.Items.Add(a);
        }

    private void button1_Click(object sender, EventArgs e)
    {
        eta = Convert.ToSingle(textBox20);

        d1 = Convert.ToSingle(textBox19);
        d2 = Convert.ToSingle(textBox18);
        d3 = Convert.ToSingle(textBox17);
        d4 = Convert.ToSingle(textBox16);

        w10 = Convert.ToSingle(textBox3);
        w11 = Convert.ToSingle(textBox2);
        w12 = Convert.ToSingle(textBox1);
        int passes = 0;

        x10 = Convert.ToSingle(textBox7);
        x11 = Convert.ToSingle(textBox11); 
        x12 = Convert.ToSingle(textBox15);
        x20 = Convert.ToSingle(textBox6);
        x21 = Convert.ToSingle(textBox10);
        x22 = Convert.ToSingle(textBox14);
        x30 = Convert.ToSingle(textBox5);
        x31 = Convert.ToSingle(textBox9);
        x32 = Convert.ToSingle(textBox13);
        x40 = Convert.ToSingle(textBox4);
        x41 = Convert.ToSingle(textBox8);
        x42 = Convert.ToSingle(textBox12);

        while (passes <= 100)
        {
            Adaline(x10, x11, x12, w10, w11, w12, d1, net1, y1, dw10, dw11, dw12, eta);

            w20 = w10 + dw10;
            w21 = w11 + dw11;
            w22 = w12 + dw12;

            Adaline(x20, x21, x22, w20, w21, w22, d2, net2, y2, dw20, dw21, dw22, eta);

            w30 = w20 + dw20;
            w31 = w21 + dw21;
            w32 = w22 + dw22;

            Adaline(x30, x31, x32, w30, w31, w32, d3, net3, y3, dw30, dw31, dw32, eta);

            w40 = w30 + dw30;
            w41 = w31 + dw31;
            w42 = w32 + dw32;

            Adaline(x40, x41, x42, w40, w41, w42, d4, net4, y4, dw40, dw41, dw42, eta);

            w10 = w40 + dw40;
            w11 = w41 + dw41;
            w12 = w42 + dw42;

            passes += 1;
        }
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }

}

}

I get thiese errors:
1 Cannot use local variable ‘net’ before it is declared. The declaration of the local variable hides the field ‘Adaline.Form1.net’
2 Cannot use local variable ‘x0’ before ot os declared.
3 Cannot use local variable ‘w0’ before ot os declared.
4 Cannot use local variable ‘x1’ before ot os declared.
.
.
.

  • 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-28T14:23:13+00:00Added an answer on May 28, 2026 at 2:23 pm

    The second error is the cause of the other errors.

    You have declared a method parameter with the same name as a method field. That hides the field inside the method.

    That error causes the parameters not to be declared correctly, and you get another error for each time you use one of the parameters in the method.

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

Sidebar

Related Questions

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; namespace ConsoleApplication1 { public
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using System.ComponentModel; using System.Data;
My Code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq;
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenericCount { class Program {

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.