I am solving an exercise where it is necessary to state the number of an employee, how many hours he works and how much he receives per hour, then the system should display the number of this employee and his salary, the problem is that the result should be displayed with dots instead of commas in the decimal place, my code so far is this:
using System;
using System.Globalization;
class URI
{
static void Main(string[] args)
{
int numeroFunc, horasTrabalhadas;
decimal valorHora;
numeroFunc = int.Parse(Console.ReadLine());
horasTrabalhadas = int.Parse(Console.ReadLine());
valorHora = decimal.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
Console.WriteLine("NUMBER = " + numeroFunc);
Console.WriteLine("SALARY = U$ " + (horasTrabalhadas * valorHora));
Console.ReadLine();
}
I know that I could solve the problem by creating a wage variable to receive the value of working hours * time value and using the Console.WriteLine("SALARY = U$ " + salario.ToString("F2", CultureInfo.InvariantCulture));
command to display the dotted message, but the exercise asks that no variables other than the requested variables be created .