Please show comments so that I may better understand what is occuring. Write a p
ID: 3563197 • Letter: P
Question
Please show comments so that I may better understand what is occuring.
Write a program that produces a multiplication table with 25 rows of com putations. Allow the user to input the ?rst and last base values for the multiplication table. Display a column in the table beginning with the ?rst base inputted value. The last column should be the ending base value entered. The ?rst row should be for 1 times the beginning base, 1 times the (beginning base value + 1), through 1 times the ending base value. The last row should be for 25 times the beginning base, 25 times the (beginning base value + 1), through 25 times the ending base value. Base values can range from 2 through 8. Display an error message if an invalid base is entered. Display an aestheti cally formatted multiplication table.
Explanation / Answer
int last,first;
Console.WriteLine("Enter first number:");
first=int.Parse(Console.ReadLine());
Console.WriteLine("Enter first number:");
last=int.Parse(Console.ReadLine());
if(last<first)
Console.WriteLine("second number hast grater than first number");
if(first<=2 && first>=8 && last<=2 && last>=8)
{ for(int c = 1; c <= 15; c++)
{
Console.WriteLine(c + "| ");
for(int i = 1; i <=last; i++)
{
Console.WriteLine(i *c + ' ');
}
Console.WriteLine(' ');
}}
Console.WriteLine("Base values can range from 2 through 8");
Console.Read();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.