c#中的交叉乘法

时间:2015-04-14 14:38:40

标签: c#

我有两个场景,我必须根据参数找到结果(通过交叉乘法)。这些情况如下:

例如,

情景 - 1:

int previousConceptCount = 100
int currentConceptCount = 20
int previousTime = 10
int currentTime = ?

Que: If 100 concepts take 10 mins to complete than how much time 20 concepts will take?
Ans: 
currentTime = (currentConceptCount * previousTime) / previousConceptCount //Works fine

//Mathematical calculation which I've added in code.  
  100     10
 ----- = -----  ==> x = (20(currentConceptCount) * 10(previousTime)) / 100(previousConceptCount)
  20       x  

情景 - 2:

int previousConceptCount = 10
int currentConceptCount = 100
int previousDocumentCount = 100
int currentDocumentCount = 100
int previousTime = 10
int currentTime = ?

    Que: If 10 concepts with 100 documents take 10 mins than how much time 100 concepts with 100 documents will take?
Ans: 
    currentTime = ?

如何在这种情况下计算currentTime。我将始终拥有conceptCounts(both previous and current)documentCounts(both previous and current),并在此基础上找到时间。我不知道需要什么数学公式,或者让我这样说,我不知道在这种情况下如何计算。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

您只需要将您的概念乘以您的文档:

(20(currentConceptCount*currentDocumentCount) * 10(previousTime)) / 100(previousConceptCount*previousDocumentCount)