diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /662/CH4/EX4.32 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '662/CH4/EX4.32')
-rwxr-xr-x | 662/CH4/EX4.32/ex4_32.JPG | bin | 0 -> 30645 bytes | |||
-rwxr-xr-x | 662/CH4/EX4.32/ex4_32.sce | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/662/CH4/EX4.32/ex4_32.JPG b/662/CH4/EX4.32/ex4_32.JPG Binary files differnew file mode 100755 index 000000000..80a9fb1e2 --- /dev/null +++ b/662/CH4/EX4.32/ex4_32.JPG diff --git a/662/CH4/EX4.32/ex4_32.sce b/662/CH4/EX4.32/ex4_32.sce new file mode 100755 index 000000000..714ef1a8d --- /dev/null +++ b/662/CH4/EX4.32/ex4_32.sce @@ -0,0 +1,23 @@ + //Example 4.32
+ //Averaging student exam scores
+
+//sample intractive program
+printf("Please Enter your name: "); // enter name
+name=input("Enter your name: ", "string");
+
+printf("Please enter the first score: "); // enter 1st score
+score1=scanf("%f");
+
+printf("Please enter the second score: "); // enter 2nd score
+score2=scanf("%f");
+
+printf("Please enter the third score: "); // enter 3rd score
+score3=scanf("%f");
+
+avg=(score1+score2+score3)/3; // calculate average
+
+printf("\n\nName: %-s\n\n", name); // write output
+printf("score 1: %-5.1f\n",score1);
+printf("score 2: %-5.1f\n",score2);
+printf("score 3: %-5.1f\n\n",score3);
+printf("Average: %-5.1f\n\n",avg);
|