SlideShare una empresa de Scribd logo
1 de 2
How do I Write a program named SubscriptValidation in which you declare an array of 10
integers and store values in the array. 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.
Create a catch block that catches any IndexOutOfRangeException and displays an appropriate
error message.
Solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Chp._11update
{
class SubscriptValidation
{
static void Main(string[] args)
{
//Write a program named SubscriptExceptionTest in which you declare an array of 20 doubles
and store values in the array.
//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.
//Create a catch block that catches any IndexOutOfRangeException and displays an appropriate
error message.
double[] newArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.6 };
int input;
for (int i = 0; i < newArray.Length; i++)
{
try
{
Console.WriteLine("Hey boss! Enter in a postion of a number in the array to display it.");
input = int.Parse(Console.ReadLine());
Console.WriteLine(newArray[input]);
}
catch (IndexOutOfRangeException e)
{
Console.WriteLine("NONONONONONONO that isn't a position in the array.");
}
}
}
}
}

Más contenido relacionado

Similar a How do I Write a program named SubscriptValidation in which you declar.docx

What is new in java 8 concurrency
What is new in java 8 concurrencyWhat is new in java 8 concurrency
What is new in java 8 concurrencykshanth2101
 
You can look at the Java programs in the text book to see how commen
You can look at the Java programs in the text book to see how commenYou can look at the Java programs in the text book to see how commen
You can look at the Java programs in the text book to see how commenanitramcroberts
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best PracticesJitendra Zaa
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]srikanthbkm
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
 
SCWCD : Handling exceptions : CHAP : 5
SCWCD : Handling exceptions : CHAP : 5SCWCD : Handling exceptions : CHAP : 5
SCWCD : Handling exceptions : CHAP : 5Ben Abdallah Helmi
 
PVS-Studio: analyzing ReactOS's code
PVS-Studio: analyzing ReactOS's codePVS-Studio: analyzing ReactOS's code
PVS-Studio: analyzing ReactOS's codeAndrey Karpov
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingVisual Engineering
 
Rechecking SharpDevelop: Any New Bugs?
Rechecking SharpDevelop: Any New Bugs?Rechecking SharpDevelop: Any New Bugs?
Rechecking SharpDevelop: Any New Bugs?PVS-Studio
 
An Introduction to Property Based Testing
An Introduction to Property Based TestingAn Introduction to Property Based Testing
An Introduction to Property Based TestingC4Media
 

Similar a How do I Write a program named SubscriptValidation in which you declar.docx (20)

What is new in java 8 concurrency
What is new in java 8 concurrencyWhat is new in java 8 concurrency
What is new in java 8 concurrency
 
You can look at the Java programs in the text book to see how commen
You can look at the Java programs in the text book to see how commenYou can look at the Java programs in the text book to see how commen
You can look at the Java programs in the text book to see how commen
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best Practices
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections Tutorials
 
Java Basics 1.pptx
Java Basics 1.pptxJava Basics 1.pptx
Java Basics 1.pptx
 
WD programs descriptions.docx
WD programs descriptions.docxWD programs descriptions.docx
WD programs descriptions.docx
 
It's always your fault
It's always your faultIt's always your fault
It's always your fault
 
srgoc
srgocsrgoc
srgoc
 
Lampstack (1)
Lampstack (1)Lampstack (1)
Lampstack (1)
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
SCWCD : Handling exceptions : CHAP : 5
SCWCD : Handling exceptions : CHAP : 5SCWCD : Handling exceptions : CHAP : 5
SCWCD : Handling exceptions : CHAP : 5
 
PVS-Studio: analyzing ReactOS's code
PVS-Studio: analyzing ReactOS's codePVS-Studio: analyzing ReactOS's code
PVS-Studio: analyzing ReactOS's code
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
Soaoui
SoaouiSoaoui
Soaoui
 
Java Lab Manual
Java Lab ManualJava Lab Manual
Java Lab Manual
 
Rechecking SharpDevelop: Any New Bugs?
Rechecking SharpDevelop: Any New Bugs?Rechecking SharpDevelop: Any New Bugs?
Rechecking SharpDevelop: Any New Bugs?
 
wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
 
An Introduction to Property Based Testing
An Introduction to Property Based TestingAn Introduction to Property Based Testing
An Introduction to Property Based Testing
 
PHP Reviewer
PHP ReviewerPHP Reviewer
PHP Reviewer
 

Más de hamblymarta

Choose a piece of children's-adolescent media from any era and analyze.docx
Choose a piece of children's-adolescent media from any era and analyze.docxChoose a piece of children's-adolescent media from any era and analyze.docx
Choose a piece of children's-adolescent media from any era and analyze.docxhamblymarta
 
Complete parts (a) and (b) below- The number of dogs per household in.docx
Complete parts (a) and (b) below- The number of dogs per household in.docxComplete parts (a) and (b) below- The number of dogs per household in.docx
Complete parts (a) and (b) below- The number of dogs per household in.docxhamblymarta
 
Comider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docx
Comider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docxComider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docx
Comider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docxhamblymarta
 
Combining estimates with projections of likely events such as turnover.docx
Combining estimates with projections of likely events such as turnover.docxCombining estimates with projections of likely events such as turnover.docx
Combining estimates with projections of likely events such as turnover.docxhamblymarta
 
Christine Danes has asked Dave and Mike to help her move into a new ap.docx
Christine Danes has asked Dave and Mike to help her move into a new ap.docxChristine Danes has asked Dave and Mike to help her move into a new ap.docx
Christine Danes has asked Dave and Mike to help her move into a new ap.docxhamblymarta
 
Cody is trying to explain to Sarah that one advantage enjoyed by plant.docx
Cody is trying to explain to Sarah that one advantage enjoyed by plant.docxCody is trying to explain to Sarah that one advantage enjoyed by plant.docx
Cody is trying to explain to Sarah that one advantage enjoyed by plant.docxhamblymarta
 
Combining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docx
Combining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docxCombining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docx
Combining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docxhamblymarta
 
Code needed in C++ Input and formatted output- Right-facing arrow Give.docx
Code needed in C++ Input and formatted output- Right-facing arrow Give.docxCode needed in C++ Input and formatted output- Right-facing arrow Give.docx
Code needed in C++ Input and formatted output- Right-facing arrow Give.docxhamblymarta
 
Class problem 5 -Animal personality- has been defined as consistent di.docx
Class problem 5 -Animal personality- has been defined as consistent di.docxClass problem 5 -Animal personality- has been defined as consistent di.docx
Class problem 5 -Animal personality- has been defined as consistent di.docxhamblymarta
 
Class Discussion - Guest Speaker - Laura Sonderup Q1- From your exper.docx
Class Discussion - Guest Speaker - Laura Sonderup Q1-  From your exper.docxClass Discussion - Guest Speaker - Laura Sonderup Q1-  From your exper.docx
Class Discussion - Guest Speaker - Laura Sonderup Q1- From your exper.docxhamblymarta
 
Choose all that apply- Which of the following proteins would have an E.docx
Choose all that apply- Which of the following proteins would have an E.docxChoose all that apply- Which of the following proteins would have an E.docx
Choose all that apply- Which of the following proteins would have an E.docxhamblymarta
 
Choose all that apply- Which of the following is something that all ce.docx
Choose all that apply- Which of the following is something that all ce.docxChoose all that apply- Which of the following is something that all ce.docx
Choose all that apply- Which of the following is something that all ce.docxhamblymarta
 
Choose every statement that is true about the cytoplasm- Cytoplasm can.docx
Choose every statement that is true about the cytoplasm- Cytoplasm can.docxChoose every statement that is true about the cytoplasm- Cytoplasm can.docx
Choose every statement that is true about the cytoplasm- Cytoplasm can.docxhamblymarta
 
Case Study- Data-Driven Transformation of Springfield's Police Force S.docx
Case Study- Data-Driven Transformation of Springfield's Police Force S.docxCase Study- Data-Driven Transformation of Springfield's Police Force S.docx
Case Study- Data-Driven Transformation of Springfield's Police Force S.docxhamblymarta
 
Charles Darwin used many different aspects of the natural world as evi.docx
Charles Darwin used many different aspects of the natural world as evi.docxCharles Darwin used many different aspects of the natural world as evi.docx
Charles Darwin used many different aspects of the natural world as evi.docxhamblymarta
 
Chapter 2 notes various problems in the use of ratios and metrics- Whi.docx
Chapter 2 notes various problems in the use of ratios and metrics- Whi.docxChapter 2 notes various problems in the use of ratios and metrics- Whi.docx
Chapter 2 notes various problems in the use of ratios and metrics- Whi.docxhamblymarta
 
Case -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docx
Case -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docxCase -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docx
Case -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docxhamblymarta
 
care plannursing diagnose risk for evidenced by prostatis nursing dia.docx
care plannursing diagnose risk for evidenced by prostatis  nursing dia.docxcare plannursing diagnose risk for evidenced by prostatis  nursing dia.docx
care plannursing diagnose risk for evidenced by prostatis nursing dia.docxhamblymarta
 
Can you please help me answer these two multiple choice questions- Tha.docx
Can you please help me answer these two multiple choice questions- Tha.docxCan you please help me answer these two multiple choice questions- Tha.docx
Can you please help me answer these two multiple choice questions- Tha.docxhamblymarta
 
can someome please write the init method please This interface defines.docx
can someome please write the init method please This interface defines.docxcan someome please write the init method please This interface defines.docx
can someome please write the init method please This interface defines.docxhamblymarta
 

Más de hamblymarta (20)

Choose a piece of children's-adolescent media from any era and analyze.docx
Choose a piece of children's-adolescent media from any era and analyze.docxChoose a piece of children's-adolescent media from any era and analyze.docx
Choose a piece of children's-adolescent media from any era and analyze.docx
 
Complete parts (a) and (b) below- The number of dogs per household in.docx
Complete parts (a) and (b) below- The number of dogs per household in.docxComplete parts (a) and (b) below- The number of dogs per household in.docx
Complete parts (a) and (b) below- The number of dogs per household in.docx
 
Comider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docx
Comider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docxComider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docx
Comider a pond or tiver adfacent to a higpo iawn in Arrica- The water.docx
 
Combining estimates with projections of likely events such as turnover.docx
Combining estimates with projections of likely events such as turnover.docxCombining estimates with projections of likely events such as turnover.docx
Combining estimates with projections of likely events such as turnover.docx
 
Christine Danes has asked Dave and Mike to help her move into a new ap.docx
Christine Danes has asked Dave and Mike to help her move into a new ap.docxChristine Danes has asked Dave and Mike to help her move into a new ap.docx
Christine Danes has asked Dave and Mike to help her move into a new ap.docx
 
Cody is trying to explain to Sarah that one advantage enjoyed by plant.docx
Cody is trying to explain to Sarah that one advantage enjoyed by plant.docxCody is trying to explain to Sarah that one advantage enjoyed by plant.docx
Cody is trying to explain to Sarah that one advantage enjoyed by plant.docx
 
Combining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docx
Combining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docxCombining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docx
Combining Prehension and Propulsion- The Foot of Ardipithecus ramidus.docx
 
Code needed in C++ Input and formatted output- Right-facing arrow Give.docx
Code needed in C++ Input and formatted output- Right-facing arrow Give.docxCode needed in C++ Input and formatted output- Right-facing arrow Give.docx
Code needed in C++ Input and formatted output- Right-facing arrow Give.docx
 
Class problem 5 -Animal personality- has been defined as consistent di.docx
Class problem 5 -Animal personality- has been defined as consistent di.docxClass problem 5 -Animal personality- has been defined as consistent di.docx
Class problem 5 -Animal personality- has been defined as consistent di.docx
 
Class Discussion - Guest Speaker - Laura Sonderup Q1- From your exper.docx
Class Discussion - Guest Speaker - Laura Sonderup Q1-  From your exper.docxClass Discussion - Guest Speaker - Laura Sonderup Q1-  From your exper.docx
Class Discussion - Guest Speaker - Laura Sonderup Q1- From your exper.docx
 
Choose all that apply- Which of the following proteins would have an E.docx
Choose all that apply- Which of the following proteins would have an E.docxChoose all that apply- Which of the following proteins would have an E.docx
Choose all that apply- Which of the following proteins would have an E.docx
 
Choose all that apply- Which of the following is something that all ce.docx
Choose all that apply- Which of the following is something that all ce.docxChoose all that apply- Which of the following is something that all ce.docx
Choose all that apply- Which of the following is something that all ce.docx
 
Choose every statement that is true about the cytoplasm- Cytoplasm can.docx
Choose every statement that is true about the cytoplasm- Cytoplasm can.docxChoose every statement that is true about the cytoplasm- Cytoplasm can.docx
Choose every statement that is true about the cytoplasm- Cytoplasm can.docx
 
Case Study- Data-Driven Transformation of Springfield's Police Force S.docx
Case Study- Data-Driven Transformation of Springfield's Police Force S.docxCase Study- Data-Driven Transformation of Springfield's Police Force S.docx
Case Study- Data-Driven Transformation of Springfield's Police Force S.docx
 
Charles Darwin used many different aspects of the natural world as evi.docx
Charles Darwin used many different aspects of the natural world as evi.docxCharles Darwin used many different aspects of the natural world as evi.docx
Charles Darwin used many different aspects of the natural world as evi.docx
 
Chapter 2 notes various problems in the use of ratios and metrics- Whi.docx
Chapter 2 notes various problems in the use of ratios and metrics- Whi.docxChapter 2 notes various problems in the use of ratios and metrics- Whi.docx
Chapter 2 notes various problems in the use of ratios and metrics- Whi.docx
 
Case -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docx
Case -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docxCase -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docx
Case -#2- Royal Bank of Canada v- Head West Energy Inc-- 2007 ABQB 154.docx
 
care plannursing diagnose risk for evidenced by prostatis nursing dia.docx
care plannursing diagnose risk for evidenced by prostatis  nursing dia.docxcare plannursing diagnose risk for evidenced by prostatis  nursing dia.docx
care plannursing diagnose risk for evidenced by prostatis nursing dia.docx
 
Can you please help me answer these two multiple choice questions- Tha.docx
Can you please help me answer these two multiple choice questions- Tha.docxCan you please help me answer these two multiple choice questions- Tha.docx
Can you please help me answer these two multiple choice questions- Tha.docx
 
can someome please write the init method please This interface defines.docx
can someome please write the init method please This interface defines.docxcan someome please write the init method please This interface defines.docx
can someome please write the init method please This interface defines.docx
 

Último

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Último (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

How do I Write a program named SubscriptValidation in which you declar.docx

  • 1. How do I Write a program named SubscriptValidation in which you declare an array of 10 integers and store values in the array. 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. Create a catch block that catches any IndexOutOfRangeException and displays an appropriate error message. Solution using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Chp._11update { class SubscriptValidation { static void Main(string[] args) { //Write a program named SubscriptExceptionTest in which you declare an array of 20 doubles and store values in the array. //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. //Create a catch block that catches any IndexOutOfRangeException and displays an appropriate error message. double[] newArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.6 }; int input; for (int i = 0; i < newArray.Length; i++) { try { Console.WriteLine("Hey boss! Enter in a postion of a number in the array to display it."); input = int.Parse(Console.ReadLine());