Question
This is for Joyce Farrell's book Microsoft visual c# 2015: an introduction to object oriented programming 6th edition page 349 PE 2. This is what
This is for Joyce Farrell's book Microsoft visual c# 2015: an introduction to object oriented programming 6th edition page 349 PE 2.
This is what I have so far. I'm trying to figure out the part where it says "if an entry is not an integer, reprompt the user." I tried doing int.TryParse(fillint[x], out exceptionHand) but it wouldn't take the array. I'd like to create a while loop that reprompts the user. I also am having difficulty figuring out how to "call a second method that accepts out parameters for the highest value in the array, lowest value in the array, sum of the values in the array, and arithmetic average." Any help would be greatly appreciated. This is for self study not school work.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Console;
namespace sandbox1.cs { class Program { static void Main(string[] args) { int[] intArray = new int[20]; fillIntArray(intArray);
} private static void fillIntArray(params int[] fillInt) { int exceptionHand; WriteLine("Enter up to 20 values or type 'y' or 'n' to stop"); for (int x = 0; x < 20; x++) { fillInt[x] = Convert.ToInt32(ReadLine()); WriteLine(fillInt[x]); }
}
} }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started