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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:29:58+00:00 2026-06-07T16:29:58+00:00

I am trying to display an array which by itself is no issue. However,

  • 0

I am trying to display an array which by itself is no issue. However, I want to add an If statement, so that if the current iteration of the score[] array that is being displayed is equal to 300 then it will put a * after it. Something like 300*

Also the array needs to display highest to lowest which I am doing by reversing the display at the moment it is in the array as lowest to highest. I was thinking about using a swap to reverse the order but if I don’t have to then I would like to solve it this way.

So far I am getting

400
332
300*
300

or in another way I tried, I got

0
0
300*
300
250 
221

I am just having issue with display and output.

static void Output(int iteration, int[] score, string[] player, double average)
    {   //opening output 
        Console.WriteLine("\n\t****** OUTPUT ******");
        Console.WriteLine("\nScores for this game.\n");

        if (score[iteration - 1] == 300)
        {
            Console.WriteLine("{0} score was {1}*", player[iteration - 1], score[iteration - 1]);
        }

        for (int i = iteration; i <= MAX_SIZE_ARRAY; i--)
        {             
                //iterates through the loop to display all the players name then score
                Console.WriteLine("{0} score was {1}", player[i], score[i]);
        }
        //displays high, low, and average score
        Console.WriteLine("\nThe high score was {0} with {1} points", player[iteration - 1], score[iteration - 1]);
        Console.WriteLine("The low score was {0} with {1} points", player[0], score[0]);
        Console.WriteLine("The team average score was {0}", average);

    }
}
}
  • 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-07T16:29:59+00:00Added an answer on June 7, 2026 at 4:29 pm

    Moving the if statement inside the loop should work:

    for (int i = iteration; i <= MAX_SIZE_ARRAY; i--)
     {             
       //iterates through the loop to display all the players name then score
       if (score[iteration - 1] == 300)
         Console.WriteLine("{0} score was {1}*", player[iteration - 1],                                  score[iteration - 1]);
       else
         Console.WriteLine("{0} score was {1}", player[i], score[i]);
     }
    

    My guess is this a school assignment to make a bowling scoring system? One suggestion would be to link player names with their scores by using a list or array of KeyValuePair, Tuple, or your own Struct definition rather than two separate arrays. Having them separate will lead to issues where they wont match up due to a bug. (removed from one and not the other, sorting changes in one, etc.)

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

Sidebar

Related Questions

I am just trying to display a list from an array that I have
I'm trying to display Tiff Images that I have a byte array for. I
I'm trying to add elements into an Associative Array, which is colors = []
I'm trying to display only the duplicate value in an array which just holds
I'm trying to create an array to display the last 5 products a customer
I am trying to format an array of numbers to display in an array
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
I am trying to display data that I am getting from server through json.
I'm trying to display an array of dictionaries variable in the table Cell Style
I am trying to display a bitmap image pixel by pixel (which explicitly means

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.