When writing a C# program just like any program like it, you have to write it in code. Writing in code means you use things like data types and variable. An example program is provided below in C# demonstrating the Hello World program.
EX:
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label3.Text = "Hello World!!"; // result
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}

EX: Here instead of codes to make a button to display text on the screen, I can use a visual program and utilize the drag and drop the elements which are like the data types and some object to specify what the elements should do. Below is a visual program that shows you the program just like the code for the C# program.


2). What does writing statements that input and output data to the screen mean?
Input statement accepts data that will be placed on the screen. Output statements display that data to the screen.
This is an example of Output Statement that display data to a screen:
Console.WriteLine("Enter the first number: ");//prompt the user
This is an example of accepting the Input Statement data from the screen:
Number1 = Convert.ToInt32(Console.ReadLine());
3). What does declaring and use of data with various types mean?
When you are declaring a data type, then you are stating the name and type of varible you are using in your application.

4). What does storing and retrieving data from the memory mean?
Storing data means to place data in a variable and retrieve data is the opposite.

5). What are arithmetic operators in C#?

6). How is the order in which operators are applied determine?
Even in programming, the basic math rules apply to the order of operation when dealing with arithmetic operators. They are parentheses (leftmost, rightmost) then multiplication, division, remainder, addition and last are subtraction.
A. ((1*5)+5)- (6/2)*2=
B. (5+5)-(6/2)*2=
C. 10-(3)*2=
D. 10-6=
E. 4
7). What are decision making statements?
These are statements that are based on a condition being met. Here is an example:
if (Percent >= 90)
lblgrade.Text = "A";
else if (Percent >= 80)
lblgrade.Text = "B";
else if (Percent >= 70)
lblgrade.Text = "C";
else if (Percent >= 60)
lblgrade.Text = "D";
else if (Percent <= 59)
lblgrade.Text = "F";
8). What are relational and equality operators?
An equality operator will test the value of a condition on the left to see if it is or is not equal to the value on the right.

A relational operators test if the values of the both the left and the right expression are greater or less than or equal to that of it opposite.

9) What are message dialogs to display messages?
The following is a message box dialog to display a message.

This type will allow you to dispilay more than one button on the message box. The following are the available buttons that are defined through the MessageBoxButtons enumeration. Its members are:
No comments:
Post a Comment