4 Replies - 387 Views - Last Post: 15 April 2013 - 10:35 PM Rate Topic: -----

#1 smiley_treat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-April 13

Making a prograb that produces a multiplication table need help

Posted 15 April 2013 - 08:10 PM

having trouble calling my check method and it wont print out the table

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication11
{
    class multiplication
    {
        int first;
        int secound;
        int _ctr;
        int [] Array1 = new int [10];
        int [] Array2 = new int [10];
        public multiplication()
        {
            Console.WriteLine("Enter first base value 2-8");
            int first = int.Parse(Console.ReadLine());
            check(first);
            
            
            Console.WriteLine("Enter lase base value 2-8");
            int secound = int.Parse(Console.ReadLine());
            check(secound);
        }
        public void loadArray(int ui, int[] array)
        {
            int count = 0;
            do
            {
                array[count] = ui;
                count++;
                ui++;
            }
            while (count < array.Length);
         }

                  public void math( int[] array, int ui)
        {
            Console.Write("   ");
            for (int i = 0; i < 10; i++)
            {
                Array1[i] = first++;
                Array2[i] = secound++;
                Console.Write("{0} ", Array1[i]);
            }

                  }
                public void Creatline()
                {
                    Console.Write("{0} ", Array2[_ctr]);
                    for (int j =0; j <10; j++ )
                    {
                        int mix =(Array2[_ctr]) * (Array2[j]);
                        Console.Write("{0}", mix);
                    }
                    _ctr++;
                    Console.WriteLine();
                }
        public void Loopcreation()
        {
            for (int i = 0; i < 15; i++)
            {
                Creatline();
            }

        }
        public void check(int ui, int[] array)
              {
                  if (ui < 2 || ui > 8)
                  {
                      Console.WriteLine("Invalid entry, Please enter value 2-8");

                  }
                  else
                  {
                      loadArray( ui, array);
                  }
              }


        }
    } 


Is This A Good Question/Topic? 0
  • +

Replies To: Making a prograb that produces a multiplication table need help

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3622
  • View blog
  • Posts: 11,290
  • Joined: 05-May 12

Re: Making a prograb that produces a multiplication table need help

Posted 15 April 2013 - 08:18 PM

In the future, also post the exact error message you are getting. Most of the time, we don't take time to download and try to compile the code that people post.

On line 69, you declared check() to take 2 parameters, but you are trying to call it with just 1 parameter. What were you expecting to happen, that the compiler would read your mind?
Was This Post Helpful? 1
  • +
  • -

#3 smiley_treat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-April 13

Re: Making a prograb that produces a multiplication table need help

Posted 15 April 2013 - 08:29 PM

no :-( im new to c# with everything i do im learning SORRY dont be mad at my ignorance...i dont understand how to fix it because i thought by cslling int ui that would be it
Was This Post Helpful? 0
  • +
  • -

#4 smiley_treat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-April 13

Re: Making a prograb that produces a multiplication table need help

Posted 15 April 2013 - 08:52 PM

i looked back up method parameters and im still lost so can you try to explain this to me
Was This Post Helpful? 0
  • +
  • -

#5 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Making a prograb that produces a multiplication table need help

Posted 15 April 2013 - 10:35 PM

public void check(int ui, int[] array)
This is your method declaration, it says "I am a method named check. I take two parameters, the first of which is called ui and it must be an integer. The second parameter is called array and it must be an array of integers. I return nothing (void) and I'm accessible to everyone (public)".
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1