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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:20:26+00:00 2026-05-31T08:20:26+00:00

So I am having problems with programming a bowling application in c# to calculate

  • 0

So I am having problems with programming a bowling application in c# to calculate 5 different scores, storing them in an array and returning the average, highest and lowest scores, I am having problems with the code for storing the array and returning the scores. Here is what i have so far:

static void Main(string[] args)
{
  //Declarations
  const double MIN_SCORE = 0;
  const double MAX_SCORE = 300;
  const int SCORE_COUNT = 5;

  int[] scores = new int[SCORE_COUNT];  //stores all the scores
  int inputScore;                          //stores one score

  double total = 0;       //to total the scores for average
  double average;     //average the grades
  double highScore;   //highest score of the games
  double lowScore;    //lowest score of the games

  //INPUT

  //loop to get scores
  for  (int bowler = 0; bowler < scores.Length; bowler++)
  {
    try
    {
      //prompt for and get the input
      Console.Write("Please enter score for game " + (bowler + 1) + ":");
      inputScore = Convert.ToInt16(Console.ReadLine());
      //valid range?
      if (inputScore > MAX_SCORE || inputScore < MIN_SCORE)
      {
        Console.WriteLine("Scores must be between " + MIN_SCORE + 
              " and " + MAX_SCORE + ". Please try again. ");
        bowler--;
      }
      else
      {
        scores[bowler] = inputScore;
      }
    }
    catch (Exception myEx)
    {
      Console.WriteLine(myEx.Message + " Please try again. ");
      bowler--;             
    }

    //PROCESS
    Array.Sort(scores); 

    //OUTPUT 
    Console.WriteLine("\n\nAverage Score for Bowler:{0}");
  }
}
  • 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-31T08:20:27+00:00Added an answer on May 31, 2026 at 8:20 am

    Add this using statement:

    using System.Linq;
    

    Then you can use:

    scores.Average();
    scores.Max();
    scores.Min();
    

    Simple enough.

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

Sidebar

Related Questions

Some members of the team are having problems programming together. Different gender, different culture,
I'm relatively new to Python and am having problems programming with Scapy, the Python
I was going through the Programming Ruby book and I'm having problems understanding the
Im having problems with classpaths. I have used them before with import but I'm
I am a beginner in JADE programming and I'm having problems running the JADE
I am new to C programming and I am having problems understanding common pitfalls
I'm still very new to Object Oriented programming and am having problems with the
I am having problems with linear programming solvers on a project I am working
I'm programming a database manager for a gameserver called OTServer, and I'm having problems
I've been trying to get into C++ programming with Eclipse, but I'm having problems

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.