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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:35:03+00:00 2026-06-12T08:35:03+00:00

Here’s my try at some basic C# programming. The program is meant to ask

  • 0

Here’s my try at some basic C# programming. The program is meant to ask the user for a size of an array, then to fill the array, print out the array and finally find the average of the numbers they used to fill the array. The program currently doesn’t compile. This is my first time doing this without any sort of reference book so can someone help explain to me what I’m missing? Thanks. EDIT: All of the program works except the part about finding the average of the numbers in the array. Also, if there are any silly mistakes that aren’t prudent for production-level coding please let me know.

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

namespace _9_21_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("enter the amount of numbers you would like to find the average of: ");
            int arraylength = Int32.Parse(Console.ReadLine());
            int[] AverageArray = new int[arraylength];

            //filling the array with user input
            for (int i = 0; i < AverageArray.Length; i++)
            {
                Console.Write("enter the numbers you wish to find the average for: ");
                AverageArray[i] = Int32.Parse(Console.ReadLine());

            }
            //printing out the array 
            Console.WriteLine("here is your array: ");
            for(int i=0; i < AverageArray.Length; i++)
            {
                Console.WriteLine(AverageArray[i]);
            }
            Console.WriteLine(FindAverage);
        }

    }
    //Method to find the average is another class for learning porpoises
    class Calcs
    {
        public static double FindAverage(int[] averageNumbers);
        int arraySum=0;

        for(int i =0; i < averageNumbers.Length; int i++)
            arraysum+=arraysum;

       return double average = arraysum/averageNumbers.Length;


    }

}
  • 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-12T08:35:04+00:00Added an answer on June 12, 2026 at 8:35 am

    Change

    Console.WriteLine(FindAverage); 
    

    to

    Console.WriteLine(Calcs.FindAverage(AverageArray)); 
    

    and

    class Calcs 
    { 
        public static double FindAverage(int[] averageNumbers); 
        int arraySum=0; 
    
        for(int i =0; i < averageNumbers.Length; int i++) 
            arraysum+=arraysum; 
    
       return double average = arraysum/averageNumbers.Length; 
    
    
    } 
    

    to

    class Calcs 
    { 
        public static double FindAverage(int[] averageNumbers)
        {
            int arraySum=0; 
    
            for(int i =0; i < averageNumbers.Length; i++) 
                arraySum+=averageNumbers[i]; 
    
            return arraySum/averageNumbers.Length; 
        } 
    }
    

    If you wish to discuss the concepts, we will be more than willing to help.

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

Sidebar

Related Questions

Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here's some sample HTML <style> .icon {display:none;} </style> <ul> <li>ABC <i id=abc class=icon>x</i></li> <li>DEF
Here is an example: I write html code inside of textarea, then I swap
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
here is my php code $titikPetaInti = array(); while($row = mysql_fetch_assoc($hasil2)) { $titikPetaInti[] =
Here is my program to find all the subsets of given set. To solve
Here's the basic setup: I have a thin bar at the top of a
Here are some facts about my app followed by a question My app has
Here is my error(if you need any more info just ask)- Error SQL query:

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.