Professional Documents
Culture Documents
Department of Computer Science and Engineering Final Open Book Examination Answer Script
Department of Computer Science and Engineering Final Open Book Examination Answer Script
[Student must either TYPE or HAND WRITE the answers in this template; In case needed just
write your detail on the paper using hand]
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
Ans of 3
:
int s = 12;
int s1 = 1;
int t = 1;
void setup()
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
pinMode(s, INPUT); //switch 1
Serial.begin(9600);
void loop()
delay(1000);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);
delay(1000);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(1000);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(6, LOW);
delay(1000);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(2, LOW);
delay(1000);
analogWrite(11, i);
delay(1000);
analogWrite(11, i);
delay(1000);
analogWrite(10, i);
delay(1000);
analogWrite(10, i);
delay(1000);
analogWrite(9, i);
delay(1000);
analogWrite(9, i);
delay(1000);
analogWrite(6, i);
delay(1000);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
analogWrite(6, i);
delay(1000);
analogWrite(5, i);
delay(1000);
analogWrite(5, i);
delay(1000);
analogWrite(3, i);
delay(1000);
analogWrite(3, i);
delay(1000);
int sv = digitalRead(s);
if(sv == 0) {
digitalWrite(11, HIGH);
delay(60);
digitalWrite(11, LOW);
delay(60);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
digitalWrite(10, HIGH);
delay(60);
digitalWrite(10, LOW);
delay(60);
digitalWrite(9, HIGH);
delay(60);
digitalWrite(9, LOW);
delay(60);
digitalWrite(6, HIGH);
delay(60);
digitalWrite(6, LOW);
delay(60);
digitalWrite(5, HIGH);
delay(60);
digitalWrite(5, LOW);
delay(60);
digitalWrite(3, HIGH);
delay(300);
digitalWrite(3, LOW);
delay(300);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
digitalWrite(8, HIGH);
delay(300);
digitalWrite(8, LOW);
delay(300);
digitalWrite(7, HIGH);
delay(300);
digitalWrite(7, LOW);
delay(300);
digitalWrite(4, HIGH);
delay(300);
digitalWrite(4, LOW);
delay(300);
digitalWrite(2, HIGH);
delay(300);
digitalWrite(2, LOW);
delay(300);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
}
if(sv1 == 0) {
t++;
delay(10);
if(t%2==0){
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(5, HIGH);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
delay(1000);
digitalWrite(3, LOW);
delay(300);
digitalWrite(8, LOW);
delay(300);
digitalWrite(7, LOW);
delay(300);
digitalWrite(4, LOW);
delay(300);
digitalWrite(2, LOW);
delay(300);
else{
digitalWrite(11, LOW);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
delay(1000);
digitalWrite(10, LOW);
delay(1000);
digitalWrite(9, LOW);
delay(1000);
digitalWrite(6, LOW);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(3, HIGH);
delay(300);
digitalWrite(8, HIGH);
delay(300);
digitalWrite(7, HIGH);
delay(300);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
digitalWrite(4, HIGH);
delay(300);
digitalWrite(2, HIGH);
delay(300);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
Ans of 4:
int L1 = 13;
int L2 = 12;
int F = 11;
int a = 0;
int a1 = 0;
void setup() {
pinMode(L1, OUTPUT);
pinMode(L2, OUTPUT);
pinMode(F, OUTPUT);
Serial.begin(9600);
void loop() {
int v; //rule 1
v = analogRead(a);
float mv = (v/1024.0)*5000;
float fh = (cel*9)/5+32;
Serial.println(fh);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
int v1;
v1 = analogRead(a1);
Serial.println(fh1);
digitalWrite(F,HIGH);
//delay(5000);
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.
** Plagiarism will be checked while you submit your response. You are advised to be honest during
the open book exam.