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.
1
Expert's answer
2014-11-13T02:50:34-0500
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)); } } }
Comments
Dear Nandhini, please use panel for submitting new questions
Dear Nandhini, You're welcome. We are glad to be helpful. If you liked our service please press like-button beside answer field. Thank you!
How to write a program to check whether the input alphabet is a vowel or not using switch case.
Thank you so much. I really found it very useful.
Leave a comment