110 likes | 186 Views
CSCI 1001. overview of. computer science. SOFTWARE DESIGN & PROGRAMMING. programming language. IN 13 LOAD 11 COMPARE 13 JUMPEQ 9 LOAD 12 COMPARE 13 JUMPLT 0 INCREMENT 14 JUMP 0 OUT 14 HALT -1 0 0. LOOP:. AGE V_END AGE END V_21 AGE LOOP COUNT
E N D
CSCI 1001 overview of computer science SOFTWARE DESIGN & PROGRAMMING
programming language
IN 13 LOAD 11 COMPARE 13 JUMPEQ 9 LOAD 12 COMPARE 13 JUMPLT 0 INCREMENT 14 JUMP 0 OUT 14 HALT -1 0 0 LOOP: AGE V_END AGE END V_21 AGE LOOP COUNT LOOP COUNT 1101 1101 0000 1011 0111 1101 1010 1001 0000 1100 0111 1101 1011 0000 0100 1110 1000 0000 1110 1110 1111 1111 1111 1111 0001 0101 0000 0000 0000 0000 END: V_END: V_21: AGE: COUNT:
#include <iostream.h> intmain(intargc, char **argv) { int age; int count = 0; while(!cin.eof()) { cin >> age; if (age >= 21) { count = count + 1; } } cout << count; return 0; }
import sys count = 0 for age in sys.stdin: if (int(age) >= 21): count = count + 1 print count
software engineering
Waterfall Model Requirements Design Implementation Testing Maintenance
Design Requirements Prototype Evaluation
http://cs1001.us/ Please read Sections 1 and 2 of the Python chapter for Monday