


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A midterm exam from a computer science course, consisting of two parts. The first part requires writing a simplesem code for a given program using the c3 language paradigm and entering data in the provided data segment. The second part involves writing a prolog predicate to sort a list into a nondecreasing order using the lesseq ordering. The document also includes sample code for bubblesort and merge sort algorithms.
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



int m = 4; int n = 16; main() { int m = 100 if (n > 10 & m > 83) m = f() else m = 0 } int f() { int k = 3, int n = 4 if (m == 1) return 4 else { n = m-- + k return ( n * f()) } } Last name: First name: Social Security:
SIMPLESEM CODE SEGMENT FOR PROBLEM # Nr Code Comments
SIMPLESEM DATA SEGMENT FOR PROBLEM # Nr. Contents Comments