diff --git a/src/lab/exp1/simulation/index.html b/src/lab/exp1/simulation/index.html index d6ceab13..017c7252 100644 --- a/src/lab/exp1/simulation/index.html +++ b/src/lab/exp1/simulation/index.html @@ -24,7 +24,7 @@


1. Given a well-behaved smooth function, integrate it over the given limits of integration ?


2. Approximating solution to integral a smooth function.


-

3. Integration Limits are from 0 to 30, b > a and b-a >= 1.


+

3. Integration Limits are from 0 to 10


diff --git a/src/lab/exp1/simulation/numericalApproximation.js b/src/lab/exp1/simulation/numericalApproximation.js index 5ca76384..3b37d95e 100644 --- a/src/lab/exp1/simulation/numericalApproximation.js +++ b/src/lab/exp1/simulation/numericalApproximation.js @@ -290,8 +290,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 > 10 || valueA2 < 1 || valueB2 > 10 || valueB2 < 1) { + alert('Integration Limits are from 0 to 10'); return false; } else { diff --git a/src/lab/exp10/simulation/index.htm b/src/lab/exp10/simulation/index.htm index 3e03797c..7e876cee 100644 --- a/src/lab/exp10/simulation/index.htm +++ b/src/lab/exp10/simulation/index.htm @@ -43,6 +43,7 @@ +
-
+
@@ -119,7 +119,7 @@
Step Execution
//function for square
-
//function for rectangle
+
//function for RightangleTriangle
//function for triangle
//function for circle
diff --git a/src/lab/exp3/simulation/advControlFlow.js b/src/lab/exp3/simulation/advControlFlow.js index 9f83de25..71fa43c3 100644 --- a/src/lab/exp3/simulation/advControlFlow.js +++ b/src/lab/exp3/simulation/advControlFlow.js @@ -34,6 +34,11 @@ window.view = { }, getInput: function() { var inputValue = document.getElementById('simpleLoopInput').value + if(inputValue<1 || inputValue>20) + { + alert('Invalid input'); + return false; + } model.inp = Number(inputValue) this.clearExecutionSection() }, @@ -377,4 +382,4 @@ window.view = { this.activateEvents() } } -window.onload = function() { view.init() } \ No newline at end of file +window.onload = function() { view.init() } diff --git a/src/lab/exp4/simulation/1-D/array.js b/src/lab/exp4/simulation/1-D/array.js index a00b245d..d4b02f15 100644 --- a/src/lab/exp4/simulation/1-D/array.js +++ b/src/lab/exp4/simulation/1-D/array.js @@ -52,7 +52,7 @@ window.view = { this.addClickEvent('btnStart', function() { view.displayElements() }) this.addClickEvent('btnNext', function() { view.sortArray() }) }, - proceedToStartButton: function() { +proceedToStartButton: function() { var userInput = this.getArraySize() if( isNaN( userInput ) === false ) { if( userInput !== 0 ) { @@ -75,6 +75,7 @@ window.view = { var random = Math.floor(Math.random()*15) this.numbers.push(String(random)) } + }, getUserInput: function() { var inputValue = document.getElementById('userInput').value @@ -83,10 +84,23 @@ window.view = { }, takeInputFromRadioBox: function() { var element = document.getElementsByName('radio_group') - if ( element[0].checked ) + if ( element[0].checked ){ this.generateRandomNumbers() - else if (element[1].checked) + this.textAreaDisable() + + + } + else if (element[1].unchecked){ this.getUserInput() + } + + + }, + + + textAreaDisable: function(){ + document.getElementById(userInput).disabled = true + }, createBoxes: function() { for ( i = 0 ; i < this.numbers.length ; i++ ) { @@ -269,4 +283,4 @@ window.view = { this.activateEvents() } } -window.onload = function() { view.init() } \ No newline at end of file +window.onload = function() { view.init() } diff --git a/src/lab/exp4/simulation/2-D/array.js b/src/lab/exp4/simulation/2-D/array.js index 5f5a1fdd..0e312ac7 100644 --- a/src/lab/exp4/simulation/2-D/array.js +++ b/src/lab/exp4/simulation/2-D/array.js @@ -121,7 +121,7 @@ window.view = { var size = this.rowsA * this.colsA for ( i = 0 ; i < size ; i++) { - var random = Math.floor(Math.random()*15) + var random = i+1 this.matrixA.push(random) } this.resetRowsAndCols() @@ -137,7 +137,7 @@ window.view = { var size = this.rowsB * this.colsB for ( i = 0 ; i < size ; i++) { - var random = Math.floor(Math.random()*15) + var random = i+1 this.matrixB.push(random) } this.disableButton('generateB') @@ -417,4 +417,4 @@ window.view = { this.activateEvents() } } -window.onload = function() { view.init() } \ No newline at end of file +window.onload = function() { view.init() } diff --git a/src/lab/exp6/simulation/IfElse/index.html b/src/lab/exp6/simulation/IfElse/index.html index 46080f90..52b734e2 100644 --- a/src/lab/exp6/simulation/IfElse/index.html +++ b/src/lab/exp6/simulation/IfElse/index.html @@ -14,12 +14,12 @@
Initialize
-
x1 = 075;   y1 = 075;
-
x2 = 275;   y2 = 075;
-
x3 = 275;   y3 = 325;
-
x4 = 075;   y4 = 325;
-
-
+
x1 = 050;   y1 = 050;
+
x2 = 250;   y2 = 050;
+
x3 = 250;   y3 = 300;
+
x4 = 050;   y4 = 300;
+
+