Username77177

Nure-Programming-ControlWork1E3-6

Oct 25th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. namespace ControlWork1
  3. {
  4.     class Thirdexercise
  5.     {
  6.         public static void thir_ex()
  7.         {
  8.             //Задание 3
  9.             /*First equation is y = e^(x/2) * b^x * (cos(z) + sin(z))
  10.               Second equation is z = sqrt((4b + x^2)/2) */
  11.             double y, z, x, hx, b;
  12.             hx = 0.2;
  13.             x = 1;
  14.  
  15.             // b = 2
  16.             // Console.WriteLine ("b = 2\tb = 4\t b = 6\tb = 8")
  17.             while (x <= 2)
  18.             {
  19.                 b = 2;
  20.                 while (b != 10)
  21.                 {
  22.                     Console.Write("b = " + b);
  23.                     z = Math.Sqrt((4 * b + Math.Pow(x, 2)) / 2);
  24.                     y = Math.Pow(Math.E, x / 2) * Math.Pow(b, x) * (Math.Cos(z) + Math.Sin(z));
  25.                     Console.WriteLine("\t\tx = {0:#.####} \nz = {1:#.####}\ty = {2:#.####}\n\n", x, z, y);
  26.                     b += 2;
  27.  
  28.                 }
  29.                 x += hx;
  30.             }
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment