Question #48844

Worker A can do a job in 15 days while worker B can do the same job in 20 days. How to write a program to calculate the total number of days required to finish the work if both the workers work simultaneously.

Expert's answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Freelance
{
class Program
{
static void Main(string[] args)
{
float work = 1;
float workerA = 15, workerB = 20;
float workA = work / workerA;
float workB = work / workerB;
float workAB = work / (workA + workB);
Console.Write("Together they will do work for {0} days.", Math.Round(workAB, 1));
}
}
}

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!

LATEST TUTORIALS
APPROVED BY CLIENTS