954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Newbie Help

Need help with this project

1. Declare two integers, one for row number entered one for the number of columns entered
2. Declare a string variable named dummy it will be used for the ending prompt.
3. Display the title [item #1] using Console.Writeline()
4. Display a blank line [2] using Console.Writeline()
5. Display an input prompt [3] using Console.Write()
6. Accept the number of rows using Console.Readline()
7. Display an input prompt [4] using Console.Write()
8. Accept the number of columns using Console.Readline()
9. Display a blank line [5] using Console.Writeline()
10. Display tab “/t” using Console.Write() [6] – this create a column for the row header.
11. In a FOR…LOOP display the number from 1 to columns. [6] Inside your Console.WriteLine() use the “/t”.
12. Display a blank line [7] using Console.Writeline()
13. Using nested for…loops to produce the matrix [8]. The “outer” for…loop counts the number of rows, the inner for…loop counts the number of columns.
14. Display a blank line [9] using Console.Writeline()
15. Display ending prompt [10].

Davenavie
Newbie Poster
4 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

So what have you done so far? It looks like step-by-step instructions on what to write, so I'm not sure what problems you are having.

One way to do this is to turn each of the instructions you have there into comments, then write the code for each comment:

// 1. Declare two integers, one for row number entered one for the number of columns entered
... code that declares two integers goes here ...

// 2. Declare a string variable named dummy it will be used for the ending prompt.
... code that declares string variable goes here ...

// 3. Display the title [item #1] using Console.Writeline()
... etc ...

// 4. Display a blank line [2] using Console.Writeline()
// 5. Display an input prompt [3] using Console.Write()
// 6. Accept the number of rows using Console.Readline()
// 7. Display an input prompt [4] using Console.Write()
// 8. Accept the number of columns using Console.Readline()
// 9. Display a blank line [5] using Console.Writeline()
// 10. Display tab “/t” using Console.Write() [6] – this create a column for the row header.
// 11. In a FOR…LOOP display the number from 1 to columns. [6] Inside your Console.WriteLine() use the “/t”.
// 12. Display a blank line [7] using Console.Writeline()
// 13. Using nested for…loops to produce the matrix [8]. The “outer” for…loop counts the number of rows, the inner for…loop counts //     the number of columns.
// 14. Display a blank line [9] using Console.Writeline()
// 15. Display ending prompt [10].
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
 

Here is what I have so far I have problem getting space after user prompt and I have error bottom of code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to My Table Software");

Console.WriteLine("");

Console.Write("Enter the number of rows");
int numrows = Convert.ToInt16(Console.ReadLine());
Console.Write("Enter the number of columns");
int numcols = Convert.ToInt16(Console.ReadLine());
{
for (int row = 1; row <= numrows; row++)
{
Console.Write(row + "\t");
}
for (int col = 1; col <= numcols; col++)
{
Console.Write(col + "\t");
{
Console.Write(row * col + "\t");
}
Console.WriteLine();
}
}
}
}
}

Davenavie
Newbie Poster
4 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

Please usqe code tags if you post code!

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: