6-16 C# Displaying Bar Chart (For Loops, C# List) - Control Statements Pt.2

preview_player
Показать описание
C# 2012 How To Program: Intro to Classes and Objects in C#
Programming Challenge 6.16: Displaying a Bar Chart using For Loops, and C# ArrayList

One interesting application of computers is to display graphs and
bar charts. Write an app that reads three numbers between 1 and 30. For each number that’s read, your app should display the same number of adjacent asterisks. For example, if your app reads the number 7, it should display *******.

Learning to code? Follow my C# tutorials for beginners. I do a lot of C# programming challenges and C# projects as part of my homework - every day!
If you are learning to program, nothing beats solving real programming exercises and coding challenges.
So don't forget to subscribe, as I release new programming videos every day!
Рекомендации по теме
Комментарии
Автор

Many thanks for this pavol: this is how I attempted to do it:
please let me know what you think:

static void Main(string[] args)
{
int input;
for (int counter = 1; counter <= 3; counter++)
{
Console.Write("Enter number : ");
input =

Console.Write(input + "-");
for(int i = 1; i <= input; i++)
{
Console.Write("*");

}
Console.WriteLine();
}

Console.WriteLine();
Console.ReadLine();
}

jobon