From f52d7743c01afa492ec457e79b935b4b45b6d616 Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 29 Jun 2020 10:14:35 +0530 Subject: [PATCH 01/10] Saturday is changed to holiday --- .../simulation/SwitchCase/basicControlFlow.js | 15 +++++++++++++-- src/lab/exp6/simulation/SwitchCase/index.html | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lab/exp6/simulation/SwitchCase/basicControlFlow.js b/src/lab/exp6/simulation/SwitchCase/basicControlFlow.js index 6822a81c..cb7a7473 100644 --- a/src/lab/exp6/simulation/SwitchCase/basicControlFlow.js +++ b/src/lab/exp6/simulation/SwitchCase/basicControlFlow.js @@ -222,7 +222,7 @@ window.view = { if (this.currentSiblingElement.className === 'break redClass') this.codeExecutionWithColourAndId('closeBrc1Id'); if (1 <= model.inputNumber && model.inputNumber <= 6) { - if (this.nextSiblingElement.id === 'holidayId') + if (this.nextSiblingElement.id === 'holidayId' || this.nextSiblingElement.id === 'holiday2Id') this.codeExecutionWithColourAndId('elseIfId'); else if (this.nextSiblingElement.id === 'workingdayId') { this.codeExecutionWithColour(); @@ -232,7 +232,10 @@ window.view = { } if ( model.inputNumber > 7 ) { if (this.nextSiblingElement.id === 'holidayId') + this.codeExecutionWithColourAndId('If2Id'); + else if (this.nextSiblingElement.id === 'holiday2Id') this.codeExecutionWithColourAndId('elseIfId'); + else if (this.nextSiblingElement.id === 'workingdayId') this.codeExecutionWithColourAndId('elseId'); else if (this.nextSiblingElement.id === 'invalidIPId') { @@ -240,6 +243,14 @@ window.view = { this.setInnerHtml('outputDayId', 'INVALID INPUT'); } } + if (model.inputNumber === 6) { + if (this.nextSiblingElement.id === 'holidayId') { + this.codeExecutionWithColour(); + this.changeOpacity('holidayImage'); + this.setInnerHtml('outputDayId', 'HOLIDAY'); + } + } + if (model.inputNumber === 7) { if (this.nextSiblingElement.id === 'holidayId') { this.codeExecutionWithColour(); @@ -249,7 +260,7 @@ window.view = { } if (this.nextSiblingElement.id === 'ifId') this.codeExecutionWithColour(); - if (this.nextSiblingElement.id === 'closeBrc2Id' || this.nextSiblingElement.id === 'elseId' || this.nextSiblingElement.id === 'elseIfId') { + if (this.nextSiblingElement.id === 'closeBrc2Id' || this.nextSiblingElement.id === 'elseId' || this.nextSiblingElement.id === 'elseIfId'||this.nextSiblingElement.id === 'If2Id') { this.codeExecutionWithColourAndId('closeBrc2Id'); } }, diff --git a/src/lab/exp6/simulation/SwitchCase/index.html b/src/lab/exp6/simulation/SwitchCase/index.html index 4af5361f..16bf9129 100644 --- a/src/lab/exp6/simulation/SwitchCase/index.html +++ b/src/lab/exp6/simulation/SwitchCase/index.html @@ -56,6 +56,8 @@
 }
 if ( strcmp( str, 'Sunday' ) == 0 ) {
  printf ( 'HOLIDAY' ); }
+
 else if ( strcmp( str, 'Saturday' ) === 0 ) {
+
  printf ( 'HOLIDAY' ); }
 else if ( str != null ) {
  printf ( 'WORKING DAY' ); }
 else {
@@ -88,4 +90,4 @@ - \ No newline at end of file + From 1a84843d612482690f4530f6612d24c3757c033d Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 29 Jun 2020 10:42:34 +0530 Subject: [PATCH 02/10] coordinates were changed --- .../exp6/simulation/IfElse/basicControlFlow.js | 18 +++++++++--------- src/lab/exp6/simulation/IfElse/index.html | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lab/exp6/simulation/IfElse/basicControlFlow.js b/src/lab/exp6/simulation/IfElse/basicControlFlow.js index 44d45ecc..5b26f698 100644 --- a/src/lab/exp6/simulation/IfElse/basicControlFlow.js +++ b/src/lab/exp6/simulation/IfElse/basicControlFlow.js @@ -262,10 +262,10 @@ window.view = { displayFigures: function () { this.drawDots(); this.drawFillRectangle(); - this.drawCircle(75, 75, '#000000'); - this.drawCircle(275, 75, '#000000'); - this.drawCircle(75, 325, '#000000'); - this.drawCircle(275, 325, '#000000'); + this.drawCircle(50, 50, '#000000'); + this.drawCircle(250, 50, '#000000'); + this.drawCircle(250, 300, '#000000'); + this.drawCircle(50, 300, '#000000'); this.displayText('(x1, y1)', 65, 65); this.displayText('(x2, y2)', 265, 65); this.displayText('(x3, y3)', 265, 345); @@ -355,7 +355,7 @@ window.view = { if (this.nextSiblingElement.id === 'codeContentIfElse4Id' || this.nextOfnextSiblingElement.id === 'codeContentIfElse6Id') { if (this.nextSiblingElement.id === 'codeContentIfElse4Id') this.codeExecutionWithColour(); - else if (model.valueOfX >= 75) + else if (model.valueOfX >= 50) this.changeFlagValue('flagValue1', 'codeContentIfElse6Id', '1'); else this.codeExecutionWithColourAndId('codeContentIfElse8Id'); @@ -363,7 +363,7 @@ window.view = { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse8Id' || this.nextOfnextSiblingElement.id === 'codeContentIfElse10Id') { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse8Id') this.codeExecutionWithColourAndId('codeContentIfElse8Id'); - else if (model.valueOfX <= 275) + else if (model.valueOfX <= 250) this.changeFlagValue('flagValue2', 'codeContentIfElse10Id', '1'); else this.codeExecutionWithColourAndId('codeContentIfElse12Id'); @@ -371,7 +371,7 @@ window.view = { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse12Id' || this.nextOfnextSiblingElement.id === 'codeContentIfElse14Id') { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse12Id') this.codeExecutionWithColourAndId('codeContentIfElse12Id'); - else if (model.valueOfY >= 75) + else if (model.valueOfY >= 50) this.changeFlagValue('flagValue3', 'codeContentIfElse14Id', '1'); else this.codeExecutionWithColourAndId('codeContentIfElse16Id'); @@ -379,7 +379,7 @@ window.view = { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse16Id' || this.nextOfnextSiblingElement.id === 'codeContentIfElse18Id') { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse16Id') this.codeExecutionWithColourAndId('codeContentIfElse16Id'); - else if (model.valueOfY <= 325) + else if (model.valueOfY <= 300) this.changeFlagValue('flagValue4', 'codeContentIfElse18Id', '1'); else this.codeExecutionWithColourAndId('codeContentIfElse20Id'); @@ -387,7 +387,7 @@ window.view = { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse20Id' || this.nextOfnextSiblingElement.id === 'codeContentIfElse22Id') { if (this.nextOfnextSiblingElement.id === 'codeContentIfElse20Id') this.codeExecutionWithColourAndId('codeContentIfElse20Id'); - else if (model.valueOfX > 75 && model.valueOfX < 275 && model.valueOfY > 75 && model.valueOfY < 325) { + else if (model.valueOfX > 50 && model.valueOfX < 250 && model.valueOfY > 50 && model.valueOfY < 300) { this.codeExecutionWithColourAndId('codeContentIfElse22Id'); this.displayTextWithColour('Output: INSIDE', 100, 40, '#FF2400'); } diff --git a/src/lab/exp6/simulation/IfElse/index.html b/src/lab/exp6/simulation/IfElse/index.html index 46080f90..474ccbaa 100644 --- a/src/lab/exp6/simulation/IfElse/index.html +++ b/src/lab/exp6/simulation/IfElse/index.html @@ -14,10 +14,10 @@
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;
@@ -125,4 +125,4 @@
- \ No newline at end of file + From 32171fb7b15e63a818760b82c22f64913239b70d Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 29 Jun 2020 10:52:44 +0530 Subject: [PATCH 03/10] coordinates were changed and coordiantes were compatible --- src/lab/exp6/simulation/IfElse/basicControlFlow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lab/exp6/simulation/IfElse/basicControlFlow.js b/src/lab/exp6/simulation/IfElse/basicControlFlow.js index 5b26f698..e8a611a7 100644 --- a/src/lab/exp6/simulation/IfElse/basicControlFlow.js +++ b/src/lab/exp6/simulation/IfElse/basicControlFlow.js @@ -233,9 +233,9 @@ window.view = { //this.getCanvas(); this.canvasContext.beginPath(); this.canvasContext.fillStyle = '#C2D995'; - this.canvasContext.fillRect (75, 75, 200, 250); + this.canvasContext.fillRect (50, 50, 200, 250); this.canvasContext.strokeStyle = '#000000'; - this.canvasContext.rect(75, 75, 200, 250); + this.canvasContext.rect(50, 50, 200, 250); this.canvasContext.stroke(); }, // drawCircle: draws circle on canvasContext according given x and y coordinates. From 4df313116fb1e87dfad20a7df08a8468c74ca191 Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 29 Jun 2020 11:14:38 +0530 Subject: [PATCH 04/10] a*(b+c) operation was added --- src/lab/exp10/simulation/index.htm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lab/exp10/simulation/index.htm b/src/lab/exp10/simulation/index.htm index 3e03797c..3242d532 100644 --- a/src/lab/exp10/simulation/index.htm +++ b/src/lab/exp10/simulation/index.htm @@ -38,6 +38,7 @@
-
4. Choose formula for area of the rectangle :
+
4. Choose formula for area of the rightangle triangle :
-
+
@@ -119,7 +119,7 @@
Step Execution
//function for square
-
//function for rectangle
+
//function for rightangle triangle
//function for triangle
//function for circle
From bed994afb43d1fdb09211f73339e5a6383a1de7b Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Fri, 3 Jul 2020 00:03:11 +0530 Subject: [PATCH 07/10] random values --- src/lab/exp4/simulation/1-D/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lab/exp4/simulation/1-D/index.html b/src/lab/exp4/simulation/1-D/index.html index a6a25b17..43c1b7fd 100644 --- a/src/lab/exp4/simulation/1-D/index.html +++ b/src/lab/exp4/simulation/1-D/index.html @@ -21,8 +21,8 @@
-
- +
+
@@ -71,4 +71,4 @@ - \ No newline at end of file + From 8f9e011b44561d27f1e2854036ca6a82e190694a Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 6 Jul 2020 11:52:35 +0530 Subject: [PATCH 08/10] factorial limit changed to 20 --- src/lab/exp3/simulation/advControlFlow.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lab/exp3/simulation/advControlFlow.js b/src/lab/exp3/simulation/advControlFlow.js index 9f83de25..152d96d4 100644 --- a/src/lab/exp3/simulation/advControlFlow.js +++ b/src/lab/exp3/simulation/advControlFlow.js @@ -34,11 +34,14 @@ window.view = { }, getInput: function() { var inputValue = document.getElementById('simpleLoopInput').value + if(Number(inputValue)>=20){alert("invalid input");} + else{ model.inp = Number(inputValue) - this.clearExecutionSection() + this.clearExecutionSection()} }, getNestedInput: function() { var inputValue = document.getElementById('nestedLoopInput').value + model.nestedInp = Number(inputValue) this.clearExecutionSection() }, @@ -377,4 +380,4 @@ window.view = { this.activateEvents() } } -window.onload = function() { view.init() } \ No newline at end of file +window.onload = function() { view.init() } From fd4bd458b3c2de21b3ca22fc4db95a02a36f6868 Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 6 Jul 2020 12:12:01 +0530 Subject: [PATCH 09/10] limits of a and b were changed to [1-10] --- src/lab/exp1/simulation/numericalApproximation.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lab/exp1/simulation/numericalApproximation.js b/src/lab/exp1/simulation/numericalApproximation.js index 5ca76384..4879c65c 100644 --- a/src/lab/exp1/simulation/numericalApproximation.js +++ b/src/lab/exp1/simulation/numericalApproximation.js @@ -294,6 +294,11 @@ window.view = { alert('Integration Limits are from 0 to 30, b > a and b-a >= 1'); return false; } + else if(Number(valueA1)>10 || valueA2<1 || Number(valueB1)<1 ||valueB2>10){ + alert("invalid input"); + return false; + } + else { model.inputValueA = valueA2; model.inputValueB = valueB2; From a6844820f565c454b7217f2f73ecb9f88111f523 Mon Sep 17 00:00:00 2001 From: manuchandu111 Date: Mon, 6 Jul 2020 12:20:04 +0530 Subject: [PATCH 10/10] range of disks changed to [1-10] --- src/lab/exp9/simulation/JS/recursion.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lab/exp9/simulation/JS/recursion.js b/src/lab/exp9/simulation/JS/recursion.js index 1417a55b..0189feb6 100644 --- a/src/lab/exp9/simulation/JS/recursion.js +++ b/src/lab/exp9/simulation/JS/recursion.js @@ -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 > 10 || input % 1 !== 0 ) + alert('invalid input') else { this.disableElement('btnOk') this.enableElement('btnStart') @@ -290,4 +290,4 @@ window.view = { this.activateEvents() } } -window.onload = function() { view.init() } \ No newline at end of file +window.onload = function() { view.init() }