So im having great difficulty trying to have my program move onto the GetInput() methods and so on ...can anyone point me in the right direction and tell me whats going on?
write a program that allows any number of values between 1 and 10 to be entered.
When the user stops entering values, display a bar chart using asterisks showing the number of
times each value was entered. When a given number is not entered, no asterisk should appear on that line
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace barChart
{
class Program
{
static List<int> myIntegers = new List<int>();
static void Main()
{
string userString;
int[] integers = new int[] {1, 2 ,3 ,4, 5, 6, 7 ,8 ,9 ,10
};
DisplayInstructions();
} // end of main
public static void DisplayInstructions()
{
Console.Write("In this program you will be allowed to enter any number of values between 1 and 10 " +
" when the you stop entering values , a bar chart will be displayed using \nasterisks" +
" showing number of times each value was entered" +
"\n\nPlease press any key to continue......");
Console.ReadKey();
// Console.Clear();
} // end of DisplayInstructions
public static string GetInput()
{
string input = "";
Console.Write("Please enter a value: ");
while (char.ToLower(Console.ReadKey(true).KeyChar) == 'y')
{
Console.Write("Would you like to enter additional values? Y/N ");
}
if (myIntegers.Count != 0)
DisplayChart();
else
Console.WriteLine(Environment.NewLine + "Program end, no user input");
return input;
} // end of GetInput
public static string ConvertToChar(int[] integers)
{
string input = "";
for (int i = 0; i < integers.Length; i++)
{
Console.Write("Enter Number {0}: ", i + 1);
input = Console.ReadLine();
integers[i] = Convert.ToChar(input);
//input.ToCharArray((char)*);
//Convert.ToChar(<string>);
}
return input;
////userString = Console.ReadLine();
////char[] myChar = userString.ToCharArray();
}
public static void DisplayChart()
{
Console.Write("\n");
Console.WriteLine("Your Results: ");
Console.WriteLine("------------- ");
Console.WriteLine();
} // end of DisplayChart
} // end of class
} // end of namespace