252x Filetype PDF File size 0.62 MB Source: uomustansiriyah.edu.iq
Programming Fundamentals1. Lab
يلولا دبع نانح.م.م / قداص ةنيز .م.م يئاسم و يحابص 2020-2019
Ex1: Write a C# program to read the student’s information (name,
gender, three scores), then compute the average.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string name;
string gender;
double d1, d2, d3, av;
Console.WriteLine("Enter the studentr's name: ");
name = Console.ReadLine();
Console.WriteLine("Enter the student's gender:");
gender = Console.ReadLine();
Console.WriteLine("Enter the first degree");
d1 = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the second degree");
d2 = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the third degree");
d3 = Convert.ToDouble(Console.ReadLine());
av = (d1 + d2 + d3) / 3;
Console.WriteLine("Name:"+ name);
Console.WriteLine("Gender:" + gender);
Console.WriteLine("average :" + av);
Console.ReadLine();
}
}
}
1
Programming Fundamentals1. Lab
يلولا دبع نانح.م.م / قداص ةنيز .م.م يئاسم و يحابص 2020-2019
2
Programming Fundamentals1. Lab
يلولا دبع نانح.م.م / قداص ةنيز .م.م يئاسم و يحابص 2020-2019
EX2: Write a VC# program to compute the area and diameter of a circle by
using different values of radius.
3
no reviews yet
Please Login to review.