06. Redecorating
Rumen wants to repaint the living room and has hired craftsmen for this purpose. 1. amount of nylon integer in the range [1... 100] 2. amount of paint integer in the range [1... 100] 3. thinner integer in the range [1... 30] 4. Hours for the craftsmen integer in the range [1... 9]unknown
csharp
a year ago
1.1 kB
60
Indexable
Never
using static System.Net.Mime.MediaTypeNames; namespace HelloWorldFirst; class Program { static void Main(string[] args) { int AmountOfNylon= int.Parse(Console.ReadLine()); int AmountOfPaint= int.Parse(Console.ReadLine()); int QuantityOfThinner= int.Parse(Console.ReadLine()); int HoursToWork = int.Parse(Console.ReadLine()); // Check if input is within the specified ranges if (AmountOfNylon< 1 || AmountOfNylon> 100 || AmountOfPaint< 1 || AmountOfPaint> 100 || QuantityOfThinner< 1 || QuantityOfThinner> 30 || HoursToWork < 1 || HoursToWork > 9) { Console.WriteLine("Invalid input values. Please enter values within the specified ranges."); } else { // Calculate the final amount double AmountMaterials = (AmountOfNylon+2) * 1.5 + AmountOfPaint * 1.1 * 14.5 + (QuantityOfThinner * 5) + 0.4; double PriceHours = (AmountMaterials * 0.3) * HoursToWork; double Amount = PriceHours + AmountMaterials; // Output the result Console.WriteLine(Amount); } } }