63 227
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #14904 in C# for Sifsilva

Question #14904
Write a program to display a a multiplication table such as young children use. A program should be capable of displaying a table of any size, specified by an integer entered into a text box.
Expert's answer
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Table
{
public partial class Form1 : Form
{
& int x, y;
& public Form1()
& {
InitializeComponent();
& }

& private void buttonShowTable_Click(object sender, EventArgs e)
& {
StringBuilder table = new StringBuilder();
x = Convert.ToInt32(textBoxX.Text);
y = Convert.ToInt32(textBoxY.Text);

for (int i = 1; i < x+1; i++)
{
for (int j = 1; j < y+1; j++)
{
& table.Append(i.ToString()+" x "+j.ToString()+" = "+(i*j).ToString()+";\n");
}
table.Append("======================\n");
}
textboxOutput.Text = table.ToString();
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions