Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lab/exp1/simulation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p></p><br>
<p class="warningText">1. Given a well-behaved smooth function, integrate it over the given limits of integration ?</p><br>
<p class="warningText">2. Approximating solution to integral a smooth function.</p><br>
<p class="warningText">3. Integration Limits are from 0 to 30, b > a and b-a >= 1.</p><br>
<p class="warningText">3. Integration Limits are from 0 to 10, b > a and b-a >= 1.</p><br>
</div><!-- end of inputDivisionSimpleLoop -->
</div><!-- end of FirstInputBlock -->
<div class = 'SecondInputBlock' >
Expand Down
8 changes: 2 additions & 6 deletions src/lab/exp1/simulation/numericalApproximation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//---------------------------------+
// Author: Parvesh Kumar Gahanolia |
// Email: <parvesh@vlabs.ac.in> |
//---------------------------------+

window.model = {
inputValueA
Expand Down Expand Up @@ -290,8 +286,8 @@ window.view = {
alert('Enter numeric value of a and b');
return false;
}
else if (valueA2 >= valueB2 || valueB2 > 30) {
alert('Integration Limits are from 0 to 30, b > a and b-a >= 1');
else if (valueA2 >11 || valueB2 > 11) {
alert('Integration Limits are from 0 to 10, b > a and b-a >= 1');
return false;
}
else {
Expand Down
82 changes: 82 additions & 0 deletions src/lab/exp10/simulation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html>
<head>
<link rel = 'stylesheet' type = 'text/css' href = 'expEvaluation.css' >
<script src = 'expEvaluation.js' ></script>
<title>Computer-Programming</title>
</head>
<body>
<div class = 'header' id = 'headerSimpleLoop' >Expression Evaluation
<div class = 'operatorSelection' >
<div>Select Operator :
<select class = 'operatorList' id = 'operatorList'>
<option id = 'arithmatic'>Arithmatic</option>
<option id = 'logical'>Logical</option>
<option id = 'bitwise'>Bitwise</option>
</select>
</div>
</div>
</div>
<a href="../index.html"><div class="vlabsIcon"></div></a>
<div class = 'inputDivision' >
<div class = 'inputDivisionTitle' ><div class = 'initializePic' ></div><div class = 'initializeText' >Initialize</div></div>
<div class = 'inputDivisionBody'>
<div class = 'instructionText' >Initialize the values</div>
<div class = 'inputFieldHolder'>
<div class = 'inputValueText' >a:&nbsp;</div>
<input class = 'inputValueField' type = 'text' value = '2' id = 'a' disabled >
<div class = 'inputValueText' >b:&nbsp;</div>
<input class = 'inputValueField' type = 'text' value = '5' id = 'b' disabled >
</div>
<div class = 'inputFieldHolder'>
<div class = 'inputValueText' >c:&nbsp;</div>
<input class = 'inputValueField' type = 'text' value = '10' id = 'c' disabled >
<div class = 'inputValueText' >d:&nbsp;</div>
<input class = 'inputValueField' type = 'text' value = '11' id = 'd' disabled >
</div>
<button class = 'button saveButton hide' id = 'buttonSave' >Save</button>
<button class = 'button editButton' id = 'buttonEdit' >Edit</button>
<select class = 'button loopList' id = 'arithmaticExpressions' >
<option> a + b - c </option>
<option> a + b / c </option>
<option> ( a + b ) / c </option>
<option> ( a + b ) * c - d </option>
<option> ( a + b ) * ( c - d ) </option>
<option> a * d % ( c - b ) * c - a * b </option>
<option> a * ( b + c ) </option>
<option> a * b + c * d</option>
</select>
<select class = 'button loopList hide' id = 'logicalExpressions' >
<option> a || b && c </option>
<option> ( a || b ) && c </option>
<option> a && b || c && d </option>
<option> a && ( b || c ) && d </option>
</select>
<select class = 'button loopList hide' id = 'bitwiseExpressions' >
<option> a | b & c ^ d </option>
<option> ( a | b ) & ( c ^ d ) </option>
<option> a << b </option>
<option> a >> b </option>
</select>
<input class = 'inputField marginBottom' type = 'text' value = 'a + b - c' id = 'selectedExpression'>
<button class = 'button startButton' id = 'buttonStart'>Start</button>
<button class = 'button stopButton hide' id = 'stopButton'>Stop</button>
<button class = 'buttonDisable nextButton' id = 'buttonNext' disabled>Next</button>
</div><!-- end of inputDivisionBody -->
</div><!-- end of inputDivision -->
<div class = 'executionDivision'>
<div class = 'executionDivisionTitle' ><div class = 'executionPic' ></div><div class = 'executionText' >Evaluation Flow of Expression</div></div>
<div class = 'stepExecutionDisplay' id = 'executionDisplay'></div><!-- end of stepExecutionDisplay -->
</div><!-- end of executionDivision -->

<div class = 'outputDivision'>
<div class = 'outputDivisionTitle' ><div class = 'outputPic' ></div><div class = 'outputText' >Code Output</div></div>
<div class = 'resultDisplay'>
<div class = 'reasoningTitle'>Step by step reasoning : </div>
<div class = 'reasoningBox' id = 'reasoningStep'></div>
<div class = 'currentStepTitle'>Current Step : </div>
<div class = 'currentStepBox' id = 'currentStep'></div>
</div><!-- end of resultDisplay -->
</div><!-- end of outputDivision -->
</body>
</html>
15 changes: 11 additions & 4 deletions src/lab/exp3/simulation/advControlFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,29 @@ window.view = {
element.addEventListener('change', method, false)
},
replaceDiv: function(x, y) {
document.getElementById(x).style.display = 'none'
document.getElementById(x).style.display = 'none'
document.getElementById(y).style.display = 'block'
},
getInput: function() {
var inputValue = document.getElementById('simpleLoopInput').value
if(inputValue>=0 && inputValue<=20 )
{
model.inp = Number(inputValue)
this.clearExecutionSection()
},
}
else{
alert("Given value is out of range....Enter the value in between 0-20");
}
},
getNestedInput: function() {
var inputValue = document.getElementById('nestedLoopInput').value
model.nestedInp = Number(inputValue)
this.clearExecutionSection()
},
activateEvents: function() {
this.addClickEvent('btnNext', function() { view.nextBtn() })
this.addClickEvent('optionFor', function() { view.clearExecutionSection() })
t
his.addClickEvent('optionFor', function() { view.clearExecutionSection() })
this.addClickEvent('optionWhile', function() { view.clearExecutionSection() })
this.addClickEvent('optionDoWhile', function() { view.clearExecutionSection() })
this.addClickEvent('btnStart', function() { view.startBtn() })
Expand Down Expand Up @@ -377,4 +384,4 @@ window.view = {
this.activateEvents()
}
}
window.onload = function() { view.init() }
window.onload = function() { view.init() }
4 changes: 2 additions & 2 deletions src/lab/exp3/simulation/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<link rel = 'stylesheet' type = 'text/css' href = 'advControlFlow.css' />
<link rel = 'stylesheet' type = 'text/css' href = 'advControlFlow.css' />
<link href = 'http://fonts.googleapis.com/css?family=Inconsolata' rel = 'stylesheet' type = 'text/css' >
<script src = 'advControlFlow.js' ></script>
<title>Computer-Programming</title>
Expand Down Expand Up @@ -142,4 +142,4 @@
</div><!-- end of resultDisplay -->
</div><!-- end of outputDivision -->
</body>
</html>
</html>
7 changes: 4 additions & 3 deletions src/lab/exp4/simulation/1-D/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
<button class = 'button okButton' id = 'btnOk' >OK</button>
</div><!-- end of arraySizeInputBlock -->
<div class = 'radioButtonDivision hide' id = 'inputButtonRadio' >
<div class = 'randomRadioButtonDivision' ><input type = 'radio' class = 'radiobutton' name = 'radio_group' id = 'btnRandom' ><label class = 'radioText' for = 'male' >Generate Random Values</label></div><!-- end of randomRadioButtonDivision -->
<div class = 'randomRadioButtonDivision' ><input type = 'radio' class = 'radiobutton' name = 'radio_group' id = 'btnRandom' ><label class = 'radioText' for = 'male' >Generate Random Values</label></div>
<textarea class = 'arrayInputArea' name = 'firstname' placeholder = 'Enter values here in comma seperated format or seperated with space' id = 'userInput' ></textarea><!-- end of randomRadioButtonDivision -->
<div class = 'enterValueRadioButtonDivision' ><input type = 'radio' class = 'radiobutton' name = 'radio_group' id = 'btnManual'><label class = 'radioText' for = 'male' >Enter Values Manually</label></div><!-- end of enterValueRadioButtonDivision -->
<textarea class = 'arrayInputArea' name = 'firstname' placeholder = 'Enter values here in comma seperated format or seperated with space' id = 'userInput' ></textarea>

<div class = 'buttonHolder' ><button class = 'buttonDisable startButton' id = 'btnStart' disabled>Start</button><button class = 'buttonDisable nextButton' id = 'btnNext' disabled>Next</button></div><!-- end of buttonHolder -->
</div><!-- end of radioButtonDivision -->
</div><!-- end of inputDivisionBody -->
Expand Down Expand Up @@ -71,4 +72,4 @@
</div><!-- end of resultDisplay -->
</div><!-- end of outputDivision -->
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions src/lab/exp6/simulation/IfElse/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<div class = 'inputDivision' >
<div class = 'inputDivisionTitle' ><div class = 'initializePic' ></div><div class = 'initializeText' >Initialize</div></div>
<div class = 'inputDivisionBody' >
<div class = 'instructionText marginTop' > x1 = 075; &nbsp; y1 = 075;</div>
<div class = 'instructionText' > x2 = 275; &nbsp; y2 = 075;</div>
<div class = 'instructionText' > x3 = 275; &nbsp; y3 = 325;</div>
<div class = 'instructionText' > x4 = 075; &nbsp; y4 = 325;</div>
<div class = 'instructionText marginTop' > x1 = 050; &nbsp; y1 = 050;</div>
<div class = 'instructionText' > x2 = 250; &nbsp; y2 = 050;</div>
<div class = 'instructionText' > x3 = 255; &nbsp; y3 = 300;</div>
<div class = 'instructionText' > x4 = 050; &nbsp; y4 = 300;</div>
<div class = 'DayInputText' ><label class = 'dText' >X : </label><input value = '150' class = 'textField' type = 'text' id = 'textFieldXId' ></div>
<div class = 'DayInputText' ><label class = 'dText'>Y : </label><input value = '150' class = 'textField' type = 'text' id = 'textFieldYId' ></div>
<div class = 'listDivision margin15' >
Expand Down Expand Up @@ -125,4 +125,4 @@
</div>
</div>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions src/lab/exp9/simulation/JS/recursion.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ window.view = {
alert('Enter number of disks first !')
else if ( isNaN(input) === true )
alert('Number of disks must be an integer value !')
else if ( input > 5 || input % 1 !== 0 )
alert('Only integral value (Greater than equal to 1 and less than equal to 5) is accepted !')
else if ( input <=0 || input>10 )
alert('Only integral value (Greater than equal to 1 and less than equal to 10) is accepted !')
else {
this.disableElement('btnOk')
this.enableElement('btnStart')
Expand Down Expand Up @@ -290,4 +290,4 @@ window.view = {
this.activateEvents()
}
}
window.onload = function() { view.init() }
window.onload = function() { view.init() }