Skip to content

Commit

Permalink
Merge pull request #17 from virtual-labs/dev
Browse files Browse the repository at this point in the history
exp 2
  • Loading branch information
prakriti5dhang authored Apr 25, 2024
2 parents 4d2e2a4 + c5d78fc commit b3d18af
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion experiment/simulation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<tr class="border-primary" style="background-color: rgb(211, 246, 255);">
<td>Project size (in KLOC)</td>
<td colspan="3">
<input id="slide" type="range" min="2" max="50" step="2" value="2" class="form-range border-primary" onchange="updateSlider()">
<input id="slide" type="range" min="2" max="50" step="2" value="2" class="form-range border-primary" > <!-- onchange="updateSlider()"-->
<div style="text-align: center; " id="sliderAmount">2</div>
</td>
</tr>
Expand Down
50 changes: 40 additions & 10 deletions experiment/simulation/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Author: Prakriti Dhang */



function updateSlider() {
/* function updateSlider() {
//var sliderDiv = document.getElementById("sliderAmount");
//sliderDiv.innerHTML = slideAmount;
var sliderval = document.getElementById("slide").value;
Expand All @@ -26,9 +26,28 @@ Author: Prakriti Dhang */
document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers
}
}*/
var sliderval = document.getElementById("slide");
var output= document.getElementById("sliderAmount")
output.innerHTML = sliderval.value;
sliderval.oninput = function() {
output.innerHTML = this.value;
var sliderval = document.getElementById("slide").value;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(sliderval))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c


var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers
}



Expand Down Expand Up @@ -128,7 +147,7 @@ function viewsolutionb(){
window.scrollBy(0, 2500);
}

/* Exercise 1 project type choice*/
/* simulation project type choice*/

var typa, typb, typc, prjtsize,effort, tdev,eaf, effcorrec, tdvcorr, ndevolpers;
var effortb,effortc, efforta, effcorc;
Expand All @@ -143,8 +162,11 @@ if(ptype.options[ptype.selectedIndex].value==0){
document.getElementById("tc").innerHTML="0.38";


var x = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = x;
var x = document.getElementById("slide");
x.setAttribute("min", 2);
x.setAttribute("max", 50);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
Expand All @@ -170,8 +192,12 @@ if(ptype.options[ptype.selectedIndex].value==1){
document.getElementById("tc").innerHTML="0.35";


var x = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = x;
var x = document.getElementById("slide");
x.setAttribute("min", 50);
x.setAttribute("max", 300);
x.setAttribute("step", 25);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
Expand All @@ -195,8 +221,12 @@ if(ptype.options[ptype.selectedIndex].value==2){
document.getElementById("tb").innerHTML="1.2";
document.getElementById("tc").innerHTML="0.32";

var x = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = x;
var x = document.getElementById("slide");
x.setAttribute("min", 300);
x.setAttribute("max", 500);
x.setAttribute("step", 25);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
Expand Down

0 comments on commit b3d18af

Please sign in to comment.