Answer to Question #53414 in C# for Aninda Kar

Question #53414
Worker A can do a job in 15 days while worker B can do the same job in 20 days. Write a program to calculate the total number of days required to finish the work if both the workers work simultaneously.
1
Expert's answer
2015-07-16T00:00:41-0400
using System;

namespace MINI_TASK
{
class Program
{
static void Main(string[] args)
{
int firstWorker = 15, secondWorker = 20;
Console.WriteLine("If worker A can do a job in {0} days",firstWorker);
Console.WriteLine("while worker B can do the same job in {0} days", secondWorker);
Console.WriteLine("So the total number of days required to finish the work ");
Console.WriteLine("if both the workers work simultaneously is {0:#.##}", 1/(1/(double)firstWorker + 1/(double)secondWorker));
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS