Advertisement
son86000

Untitled

Feb 28th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace PROJETIL
  8. {
  9.     class Program
  10.     {
  11.         private static double Vi;
  12.         static void Main(string[] args)
  13.         {
  14.             /* Declaração de dados */
  15.             double HMax;
  16.             double VI;
  17.             double teta;
  18.             double d = 9.81;
  19.             double sen = 1;
  20.            
  21.             Console.WriteLine("Informe o ângulo:");
  22.             teta = double.Parse(Console.ReadLine());
  23.  
  24.             /* Processamento */
  25.             HMax = (Math.Pow(Vi * (Math.Sin(teta)), 2)) / (2 * g);
  26.  
  27.                 /* Saída de dados */
  28.  
  29.                 if (HMax <= d)
  30.                 {
  31.                     Console.WriteLine("A distância do seu projetil foi de "  + d +
  32.                                       " e a altura máxima foi de " + HMax + " A maior já obtida!");
  33.                 }
  34.  
  35.                 else
  36.                 {
  37.                     Console.WriteLine("Dado desconhecido!");
  38.                 }
  39.                 Console.ReadKey();
  40.           }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement