У вас вопросы?
У нас ответы:) SamZan.net

99 градусів по фаренгейту - int f; -- значення температури по фаренгейту

Работа добавлена на сайт samzan.net: 2016-03-13

Поможем написать учебную работу

Если у вас возникли сложности с курсовой, контрольной, дипломной, рефератом, отчетом по практике, научно-исследовательской и любой другой работой - мы готовы помочь.

Предоплата всего

от 25%

Подписываем

договор

Выберите тип работы:

Скидка 25% при заказе до 27.4.2025

Фаренгейт

using System;

namespace Fahrenheit

{    class Program

   {

       static void Main(string[] args)

       {

            /*Ця програма переводить значення температури по фаренгейту у значення температури по Цельсію та виводить на екран таблицю значень для 0..99 градусів по фаренгейту */

           

           int f; // значення температури по фаренгейту

           double c; // значення температури по Цельсію

           int counter; //допоміжний рахівник

           counter = 0;

           for (f=0; f<=99;f++)

           { //перетворення у градуси по Фарентейту

                   c=5.0/9.0*f+32.0;

                   Console.WriteLine("{0} gradusiv po Cel'si'u dorivn'u'ut {1} gradusiv po Farenge'ytu", f, c);

                    counter++; // рахуємо рядочки

                    

                   if (counter == 10) // після кожного 10-го рядочка пропускаємо пустий рядок

                   {

                       Console.WriteLine(); //виводимо пустий рядок

                       counter = 0; //обнуляємо рахівник для наступного блока рядочків

           

                   }

               }

           }

       }

   }

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

{

   class Program

   {

       static double Input_double()

       {

           double res;

           Console.WriteLine("vvedit' diysne chislo");

           res = double.Parse(Console.ReadLine());

           return res;

       }

       static double Z1(double a)

       {

           double res;

           res = ((Math.Tan(2 * a)) + (1 / Math.Cos(2 * a)));

           return res;

       }

       static double Z2(double x)

       {

           double res;

           res = Math.Log(((Math.Pow(1 + x * x, 0.5)) + (Math.Pow(1 + x, 0.5))));

           return res;

       }

       static void Main()

       {

           double a = Input_double();

           double x = Input_double();

           Console.WriteLine("Z1 ({0}={1:f4}", a, Z1(a));

           Console.WriteLine("Z2 ({0})={1:f4}", x, Z2((x)));

           Console.ReadLine();

     

       }

   }

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
class Program
{
static double Input_double()
{
double res;
Console.WriteLine("vvedit' diysne chislo");
res = double.Parse(Console.ReadLine());
return res;
}
static double Z1(double a)
{
double res;
res = ((Math.Tan(2 * a)) + (1 / Math.Cos(2 * a)));
return res;
}
static double Z2(double x)
{
double res;
res = Math.Log(((Math.Pow(1 + x * x, 0.5)) + (Math.Pow(1 + x, 0.5))));
return res;
}

static void Main()
{
double a = Input_double();
double x = Input_double();
Console.WriteLine("Z1 ({0}={1:f4}", a, Z1(a));
Console.WriteLine("Z2 ({0})={1:f4}", x, Z2((x)));
Console.ReadLine();

}
}
}

Мой Z1 Z2          +          

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

{

   class Program

   {

       static double Input_double()

       {

           double res;

           Console.WriteLine("vvedit' diysne chislo");

           res = double.Parse(Console.ReadLine());

           return res;

       }

       static double Z1(double a)

       {

           int k = 2;

           double res;

           res = (Math.Cos(k/2 + 3)) / (1 - Math.Sin(3*a) - 3.14);

           return res;

       }

       static double Z2(double x)

       {

           double res;

           res = Math.Pow(1+Math.Pow(1+Math.Pow(x*x+x+1, 0.5),0.5),0.5);

           return res;

       }

       static void Main()

       {

           double a = Input_double();

           double x = Input_double();

           Console.WriteLine("Z1 ({0}={1:f4}", a, Z1(a));

           Console.WriteLine("Z2 ({0})={1:f4}", x, Z2((x)));

           Console.ReadLine();

       }

   }

}

Координати Юля

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class ABC
{
static double Input_double()
{
double res = 0;
Console.WriteLine("vvedit' A,B,C");
try
{
res = double.Parse(Console.ReadLine());
}
catch (Exception e)
{
Console.WriteLine(e);
}
return res;
}
static double distance(double x1, double y1, double x2, double y2)
{
double res = (Math.Pow((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1), 0.5));
return res;
}
static bool B_or_C(double x1, double y1, double x2, double y2, double x3, double y3)
{
bool res = true;
if (distance(x1, y1, x2, y2) > distance(x1, y1, x3, y3))
res = false;
return res;
}
static void Main()
{
double x1;
double y1;
double x2;
double y2;
double x3;
double y3;
char contine = '  ';
do
{
x1 = Input_double();
y1 = Input_double();
x2 = Input_double();
y2 = Input_double();
x3 = Input_double();
y3 = Input_double();
if (B_or_C(x1, y1, x2, y2, x3, y3))
{ Console.WriteLine("Tochka B ({0},{1}) blyjche do A ({2},{3}) nij C({4},{5}) do A({2},{3})", x2, y2, x1, y1, x3, y3); }
contine = char.Parse(Console.ReadLine());
}
while (contine == 'Y');
}
}

Логічні вирази ч.1

Задача про координати

using System.Text;

namespace ConsoleApplication7

{

   class Koordunatu

   {

       static int Input_int()

       {

           int res = 0;

           Console.WriteLine("wedit'koordunatu");

           try

           { res = int.Parse(Console.ReadLine()); }

           catch (Exception e)

           {

               Console.WriteLine(e);

           }

           return res;

       }

       static int koordunatu(int X, int Y)

       {

           int res = 0;

           if ((X == 0) && (Y == 0))

               res = 1;

           else if (Y == 0)

               res = 2;

           else if (X == 0)

               res = 3;

           return res;

       }

       static void Main()

       {

           int X;

           int Y;

           X = Input_int();

           Y = Input_int();

           char contin = ' ';

           do

           {

               {

                   

                   Console.WriteLine("", koordunatu(X,Y));

               }

               contin = char.Parse(Console.ReadLine());

           }

           while (contin == 'Y');

       }

   }

}

Логічні вирази ч.2 (шахи)+

Логічні вирази ч.3 (день, місяць,рік)

class YMD

{ static int Input_YMD()

{int res=0 ;

   try

   { res=int.Parse ( Console.ReadLine());

   }

   catch (Exception e)

   { Console.WriteLine (e);

   }

   int Y ;

   int M ;

   int D ;

   Console.WriteLine ("Wedit poslidovnist' chisel, shco ytvoryyt daty");

   if ((res<=0)||(res>31))

       res=0;

   return res;}

{ static char Input_Poslidovnist ()

{char res=' ';

   try{res char.Parse (Console.ReadLine());

   }

   catch (Exception e)

   {Console.WriteLine (e);

   }

   if ((res!='Y')||(res!='M')||(res!='D'))

       res=' ';

   return res;}

{ static char Turn(char start, int )

ЛР6 Робота з циклами

Обробка послідовностей ч.1

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

static int input ()

{

   static void n_even(int N)

   {int k;

       int a=0;

       int nomer=0;

       do { a=Input_n();

       nomer ++;

       if (a%2==0)

       Console.WriteLine("nomer {0}", nomer);

       k++;

       }

       Console.WriteLine("kilkist {0}", k);

   }}

static void Main

Цикли ч.2

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

static double parabola (double a, double b, double c, double x)

{return a*(Math.cos(b))*x+c*(Math.sin(b))*x;

}

   static void Print_table (double a, double b, double c, double_P, Double_-P, int n)

   { for (K = 1; K<=n; K++)

   {Console.WriteLine("x={0} y={1}" P, parabola (a, b, c, P));

       P+=(P-(-P))/n;}}

 static void Main()

       {

           

           string answer = " ";

          

           do

           {

               double a = Input_double();

               double b = Input_double();

               double c = Input_double();

               double x = Input_double();

               int P=3,14

               int -P= -3,14

Print_table (a,b,c, P,-P,n)

Console.WriteLine("if you wont restart program input Yes or yes");

           answer = Console.ReadLine();

       }

       while ((answer == "Yes") || (answer == "yes"));

   }

}

Інтерфейс Захарченка

using System;

namespace perevirka

{

   class Program

   {

       static double Input_x()

       {

           double x = 0;

           try

           {

               Console.WriteLine("vvedit' chislo ");

               x = double.Parse(Console.ReadLine());

               return x;

           }

           catch (Exception e)

           {

               Console.WriteLine(e);

               Console.WriteLine("washe chislo 0");

           }

               return x;

           

       }

       static void Main()

       {

           

           string answer = " ";

          

           do

           {

               double x = Input_x();

               double y = Input_x();

               double z = Input_x();

              

               if ((x<y)&&(y>z))

                   Console.WriteLine("z={0} y={1} x={2} ",z,y,x);

               if ((x<y)&&(z<x))

                   Console.WriteLine("z={0} x={1} y={2} ",z,x,y);

               if ((z<x)&&(y<z))

                   Console.WriteLine("y={0} z={1} x={2} ",y,z,x);

               if ((x<z)&&(y<x))

                   Console.WriteLine("y={0} x={1} z={2} ",y, x, z);

               if ((z<y)&&(x<z))

                   Console.WriteLine("x={0} z={1} y={2} ",x,z,y);

               if ((y<z)&&(x<y))

                   Console.WriteLine("x={0} y={1} z={2} ",x,y,z);

               Console.WriteLine("if you wont restart program input Yes or yes");

               answer = Console.ReadLine();

           }

           while ((answer == "Yes") || (answer == "yes"));

       }

   }

}

Цикл ЛР6

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication18

{

   class Program

   {

       static int Input_n()

       {

           int n = 0;

           try

           {

               Console.WriteLine("vvedit' chislo");

               n = int.Parse(Console.ReadLine());

           }

           catch (Exception e)

           {

               Console.WriteLine(e);

           }

           if (n < 0) n = 0;

           return n;

       }

       static double Input_double()

       {

           double res;

           Console.WriteLine(" vvedit' di'ysni chysla a, b, c, x_1, x_2");

           res = double.Parse(Console.ReadLine());

           return res;

       }

       static double parabola(double a, double b, double c, double x)

       { return a * (Math.Cos(b)) * x + c * (Math.Sin(b)) * x; }

       static void print_table(double a, double b, double c, double x_1, double x_2, int n)

       {

           for (int k = 1; k <= n; k++)

           {

               Console.WriteLine(" x = {0}={1:f3} , y = {1}={1:f3}", x_1, parabola(a, b, c, x_1));

               x_1 += (x_2 - x_1) / n;

           }

       }

       static void Main()

       {

           string answer = " ";

           do

           {

               int n = Input_n();

               double a = Input_double();

               double b = Input_double();

               double c = Input_double();

               double x_1 = Input_double();

               double x_2 = Input_double();

               print_table(a, b, c, x_1, x_2, n);

               Console.WriteLine("if you wont restart program input Yes or yes");

               answer = Console.ReadLine();

           }

           while ((answer == "Yes") || (answer == "yes"));

       }

   }

}

 




1. восхода и заката
2. Планирование и прогнозирование НТП в РБ
3. деталь 1 2 3 4 Шарикоподшипник Муфта компенсирующая Шайба пружинная Редуктор
4. Початкові відомості про компютер
5. по теме семинара Изменения в законодательстве о закупках товаров работ услуг отдельными
6. Лекция 22 Требования техники безопасности при работе на токарных станках При работе на токарных станках
7. ТЕМАТИЧЕСКИЙ ПЛАН УЧЕБНОЙ ДИСЦИПЛИНЫ ОП
8. по теме Нейролептики
9. Тема 8 Задание 13 1
10. неправильно произносит звуки стесняется разговаривать с незнакомыми людьми- 2 мать не отмечает неправиль.html