Write a program that reads an employee's number, his/her worked hours number in a month and the amount he received per hour. Print the employee's number and salary that he/she will receive at end of the month, with two decimal places.
- Don’t forget to print the line's end after the result, otherwise you will receive “Presentation Error”.
- Don’t forget the space before and after the equal signal and after the U$.
Solution
Before seeing the solution make sure that you tried enough. Don’t paste
the whole code, just find out the logic
using System;
namespace _1008_Salary
{
class Program
{
static void Main(string[] args)
{
int e, h;
double s, salary;
e = Convert.ToInt32(Console.ReadLine());
h = Convert.ToInt32(Console.ReadLine());
s = Convert.ToDouble(Console.ReadLine());
salary = h * s;
Console.WriteLine("NUMBER = " + e);
Console.WriteLine("SALARY = U$ " + salary.ToString("f2"));
Console.ReadKey();
}
}
}
Post a Comment