TOPIC

Runtime error

Vitor Daniel dos Santos Ricardo asked 4 months ago

Não entendo o porque do Runtime error

int opcao, Q;
  double V;

  opcao = Int32.Parse(Console.ReadLine());
  Q = Int32.Parse(Console.ReadLine());

  switch (opcao) {
     case 1:
          V =  Q * 4.00;
          Math.Round( V , 2 );
          Console.WriteLine ( "Total:"+ " R$ "+V.ToString("0.00") );
          break;
     case 2:
          V = Q * 4.50;
          Math.Round( V , 2 );
          Console.WriteLine ( "Total:"+ " R$ "+V.ToString("0.00") );             
          break;
     case 3:
          V = Q * 5.00;
          Math.Round( V , 2 );
          Console.WriteLine ( "Total:"+ " R$ "+V.ToString("0.00") );
          break;
     case 4:
          V = Q * 2.00;
          Math.Round( V , 2 );
          Console.WriteLine ( "Total:"+ " R$ "+V.ToString("0.00"));
          break;
     case 5:
          V = Q * 1.50;
          Math.Round( V , 2 );
          Console.WriteLine ( "Total:"+ " R$ "+ V.ToString("0.00"));
          break;
     default:
          Console.WriteLine ( "Não é uma opção válida" );
          break;
  }  

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.