in c# i need to Write the program SubscriptExceptionTest in which you use an array of 10 doubles. Write a try block in which you place a loop that prompts the user for a subscript value and displays the value stored in the corresponding array position or asks the user to quit the program by entering 99. Create a catch block that catches any IndexOutOfRangeException and displays the message: Index was outside the bounds of the array. my code so far is  using System; using static System.Console; class SubscriptExceptionTest {    static void Main()    {        double[] array = {20.3, 44.6, 32.5, 46.7, 89.6,                         67.5, 12.3, 14.6, 22.1, 13.6};        // Your code here    } }

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter11: Exception Handling
Section: Chapter Questions
Problem 1E
icon
Related questions
Question

in c# i need to

Write the program SubscriptExceptionTest in which you use an array of 10 doubles. Write a try block in which you place a loop that prompts the user for a subscript value and displays the value stored in the corresponding array position or asks the user to quit the program by entering 99. Create a catch block that catches any IndexOutOfRangeException and displays the message: Index was outside the bounds of the array.

my code so far is 

using System;
using static System.Console;
class SubscriptExceptionTest
{
   static void Main()
   {
       double[] array = {20.3, 44.6, 32.5, 46.7, 89.6,
                        67.5, 12.3, 14.6, 22.1, 13.6};
       // Your code here
   }
}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Exception Handling Keywords
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT