You are on page 1of 2

1 ‫עבודה מספר‬

:1 ‫שאלה‬
namespace firstprog
{
class Program
{
static void Main(string[] args)
{
int halfShekel, shekel, snekel, total;
Console.WriteLine("enter how much halfshekels you have");
halfShekel = int.Parse(Console.ReadLine());
Console.WriteLine("enter how much shekels you have");
shekel = int.Parse(Console.ReadLine());
Console.WriteLine("enter how much snekels you have");
snekel = int.Parse(Console.ReadLine());
total = halfShekel / 2 + shekel + snekel * 2;
Console.WriteLine("your total is ={0}", total);
Console.ReadLine();

}
}
}
:2 ‫שאלה‬

namespace firstprog
{
class Program
{
static void Main(string[] args)
{
const double rate = 3.65;
int payments;
double x,smartPhone;
Console.WriteLine("please enter how much is your discount coupon ");
x = double.Parse(Console.ReadLine());
smartPhone = ((rate * 649) - x) * 1.02;
Console.WriteLine("you need to pay ={0:F0}", smartPhone);
Console.WriteLine("please enter how many payments you want to split the payment into ");
payments = int.Parse(Console.ReadLine());
Console.WriteLine("your payment will split into {0} payments", payments);
Console.WriteLine("each payment is {0:F2}", smartPhone/payments);
Console.ReadLine();

}
}
}

You might also like