You are on page 1of 7

‫אלקטרוניקה‬

‫המורה ‪ :‬תיראן חיסאוי‪.‬‬


‫תלמידה‪ :‬נדין שמא‪.‬‬
using System; 18 ‫שאלה‬:

namespace ‫סיואר_בקרה‬
{
class Program
{
static void Main(string[] args)
{
double R1, R2, R3, E,Ieq;
Console.WriteLine("please enter the value of R1:");
R1 = double.Parse(Console.ReadLine());
Console.WriteLine("please enter the value of R2:");
R2 = double.Parse(Console.ReadLine());
Console.WriteLine("please enter the value of R3:");
R3 = double.Parse(Console.ReadLine());
Console.WriteLine("please enter the value of E:");
E = double.Parse(Console.ReadLine());
Ieq = E / R1 + E / R2 + E / R3;
Console.WriteLine("I1={0:F2}[A]", E / R1);
Console.WriteLine("I2={0:F2}[A]", E / R2);
Console.WriteLine("I3={0:F2}[A]", E / R3);
Console.WriteLine("Ieq={0:F2}[A]",Ieq);
Console.WriteLine("Req={0:F2}[ohm]", E / Ieq);

}
}
:19 ‫שאלה‬
using System;

namespace ConsoleApp16
{
class Program
{
static void Main(string[] args)
{
const double PI = 3.14;
double R;
Console.WriteLine("please insert the value of R: ");
R = double.Parse(Console.ReadLine());
Console.WriteLine("P of circle= {0:F2}", 2 * PI * R);
Console.WriteLine("S of circle= {0:F2}", R * PI * R);
Console.ReadLine();

}
}
}
:3 ‫שאלה‬
using System;

namespace ConsoleApp17
{
class Program
{
static void Main(string[] args)
{
int x, y;
Console.WriteLine("please insert 2 numbers:");
x = int.Parse(Console.ReadLine());
y = int.Parse(Console.ReadLine());
if (x == y)
Console.WriteLine("the two numbers are equal");
else if (x > y)
Console.WriteLine("the big number is:{0}", x);
else if (y > x)
Console.WriteLine("the big number is:{0}", y);
Console.ReadLine();

}
}
}
:5 ‫שאלה‬

using System;

namespace ConsoleApp18
{
class Program
{
static void Main(string[] args)
{
char ch;
Console.WriteLine(" enter a small letter (a-z): ");
ch = char.Parse(Console.ReadLine());
int ch1;
ch1 = (int)ch;
if (97 <= ch1 && ch1 <= 122)
Console.WriteLine("the letter is small ");
else
Console.WriteLine("not good are you dumb");
Console.ReadLine();
}
}
}
:7 ‫שאלה‬
using System;

namespace ConsoleApp19
{
class Program
{
static void Main(string[] args)
{
int x;
Console.WriteLine(" insert your grade :");
x = int.Parse(Console.ReadLine());
if (x < 55)
Console.WriteLine("Faild");
else if (x >= 55 && x <= 84)
Console.WriteLine("Pass");
else if (x >= 85)
Console.WriteLine("Excellent");
Console.ReadLine();

}
}
}

You might also like