static void Main(string[] args) { double A, B, MEDIA; A = double.Parse(Console.ReadLine()); B = double.Parse(Console.ReadLine()); MEDIA = ((A * 3.5) + (B * 7.5)) / 11; Console.WriteLine("MEDIA = " + MEDIA.ToString("F5")); Console.ReadLine(); }
static void Main(string[] args) { double A, B, MEDIA; A = double.Parse(Console.ReadLine()); B = double.Parse(Console.ReadLine()); MEDIA = (A * 3.5 + B * 7.5) / 11.0; Console.WriteLine("MEDIA = " + MEDIA.ToString("F5", CultureInfo.InvariantCulture)); }
static void Main(string[] args) { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine()); B = double.Parse(Console.ReadLine()); C = double.Parse(Console.ReadLine()); MEDIA = ((A * 2) + (B * 3) + (C * 5)) / 10; Console.WriteLine("MEDIA = " + MEDIA.ToString("F1")); Console.ReadLine(); }
static void Main(string[] args) { double A, B, MEDIA; A = Convert.ToDouble(Console.ReadLine()); B = Convert.ToDouble(Console.ReadLine()); MEDIA = ((A * 3.5 + B * 7.5) / (3.5 + 7.5)); Console.WriteLine("MEDIA = " + MEDIA.ToString("f5")); Console.ReadKey(); }
static void Main(string[] args) { double A, B, C, MEDIA; A = Convert.ToDouble(Console.ReadLine()); B = Convert.ToDouble(Console.ReadLine()); C = Convert.ToDouble(Console.ReadLine()); MEDIA = ((A * 2 + B * 3 + C * 5) / (2 + 3 + 5)); Console.WriteLine("MEDIA = " + MEDIA.ToString("f1")); Console.ReadKey(); }
static void Main(string[] args) { double A, B, MEDIA; A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); MEDIA = ((A * 3.5) + (B * 7.5)) / 11; Console.WriteLine("MEDIA = " + MEDIA.ToString("f5"), CultureInfo.InvariantCulture); Console.ReadLine(); }
static void Main(string[] args) { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); C = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); MEDIA = (A * 2 + B * 3 + C * 5) / 10.0; Console.WriteLine("MEDIA = " + MEDIA.ToString("F1", CultureInfo.InvariantCulture)); }
static void Main(string[] args) { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); C = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); MEDIA = ((A * 2.00) + (B * 3.00) + (C * 5.00)) / (2 + 3 + 5); Console.WriteLine("MEDIA = " + MEDIA.ToString("F1", CultureInfo.InvariantCulture)); }
static void Main(string[] args) { double a, b, MEDIA; a = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); b = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); MEDIA = ((a * 3.5) + (b * 7.5)) / 11; Console.WriteLine($"MEDIA = {MEDIA.ToString("F5", CultureInfo.InvariantCulture)}"); Console.ReadKey(); }
static void Main(string[] args) { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture) * 2.0; B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture) * 3.0; C = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture) * 5.0; MEDIA = (A + B + C) / 10; Console.WriteLine("MEDIA = " + MEDIA.ToString("F1")); }
static void uri1006() { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine()); B = double.Parse(Console.ReadLine()); C = double.Parse(Console.ReadLine()); MEDIA = (A * 2 + B * 3 + C * 5) / 10; Console.WriteLine("MEDIA = " + MEDIA.ToString("f1")); Console.ReadLine(); }
static void Main(string[] args) { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); C = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); MEDIA = ((A * 2) + (B * 3) + (C * 5)) / 10; Console.WriteLine("MEDIA = " + MEDIA.ToString("f1", CultureInfo.InvariantCulture)); Console.ReadKey(); }
static void Main(string[] args) { double a, b, MEDIA; a = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); b = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); a *= 3.5; b *= 7.5; MEDIA = (a + b) / 11; Console.WriteLine("MEDIA = " + MEDIA.ToString("F5", CultureInfo.InvariantCulture)); }
static void Main(string[] args) { double A, B, C, MEDIA; A = double.Parse(Console.ReadLine()); B = double.Parse(Console.ReadLine()); C = double.Parse(Console.ReadLine()); MEDIA = (A * 2 + B * 3 + C * 5) / (2 + 3 + 5); Console.WriteLine("MEDIA = " + MEDIA.ToString("F1")); Console.ReadKey(); }
static void Main(string[] args) { /*Leia 3 valores, no caso, variáveis A, B e C, que são as três notas de um aluno. A seguir, * calcule a média do aluno, sabendo que a nota A tem peso 2, a nota B tem peso 3 e a nota * C tem peso 5. Considere que cada nota pode ir de 0 até 10.0, sempre com uma casa decimal.*/ double A, B, C, MEDIA; A = double.Parse(Console.ReadLine()); B = double.Parse(Console.ReadLine()); C = double.Parse(Console.ReadLine()); MEDIA = (A * 2.0 + B * 3.0 + C * 5.0) / 10.0; Console.WriteLine("MEDIA = " + MEDIA.ToString("f1")); Console.ReadLine(); }
private void Processar(Object sender, EventArgs e) { float SOMA, MEDIA, VALOR; int J; SOMA = 0; J = 0; foreach (Control CONTROLE in this.Controls) { if (CONTROLE is TextBox) { VALOR = Convert.ToSingle((TextBox)CONTROLE).Text); SOMA += VALOR; J += 1; } MEDIA = SOMA / 8; this.Controls["Label3"].Text = MEDIA.ToString(); } }
static void Main(string[] args) { //Definição de Váriaveis double A, B, C, MEDIA; /* Atribuição de Váriaveis. * * A leitura de dados de um tipo de valor no visual studio são regrados * e precisam de castings, ou seja, * precisam ser convertidos para o tipo que se deseja * além disso precisa se utilizar o CultureInfo para formatar o número*/ A = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); B = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); C = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); //Cálculos MEDIA = ((A * 2.0) + (B * 3.0) + (C * 5.0)) / 10; //Console.WriteLine Console.WriteLine("MEDIA = " + MEDIA.ToString("F1"), CultureInfo.InvariantCulture); /*Como o terminal faz os calculos e fecha o terminal precisa-se * colocar o Console.ReadLine */ Console.ReadLine(); }
private void Page_Unloaded(object sender, RoutedEventArgs e) { MEDIA.Stop(); }