CMPSC 461

Pennsylvania State University - All Campuses

Hier vind je de beste samenvattingen om te slagen voor CMPSC 461. Er zijn o.a. samenvattingen, aantekeningen en oefenvragen beschikbaar.

Alle 10 resultaten

Sorteer op:

CMPSC 131 design document
  • College aantekeningen

    CMPSC 131 design document

  • It is in-depth CMPSC 131 design documents
  • shamakvagarwal
    $10.99 Meer Info
15–312: Principles of Programming Languages Midterm Examination (Sample Solutions)
  • Tentamen (uitwerkingen)

    15–312: Principles of Programming Languages Midterm Examination (Sample Solutions)

  • 15–312: Principles of Programming Languages Midterm Examination (Sample Solutions)
  • ExamsConnoisseur
    $8.49 Meer Info
CMPSC 461: Programming Language Concepts Assignment 6 Solution
  • Tentamen (uitwerkingen)

    CMPSC 461: Programming Language Concepts Assignment 6 Solution

  • CMPSC 461: Programming Language Concepts Assignment 6 Solution Problem 1 [8pt] Prove that the following two Hoare triples are valid. (Hint: in predicate logic P1 ⇒ P2 is equivalent to ¬P1 ∨ P2). a) (4pt) {x > −1} y := x * 2; y := y + 3; {y > 0} Solution: wp(y:=x*2;y:=y+3, y > 0) = wp(y:=x*2, wp(y:=y+3, y > 0)) = wp(y:=x*2, y + 3 > 0) = x ∗ 2 + 3 > 0 Moreover, the precondition
  • ExamsConnoisseur
    $8.49 Meer Info
CMPSC 461: Programming Language Concepts Assignment 1 Solutions
  • Tentamen (uitwerkingen)

    CMPSC 461: Programming Language Concepts Assignment 1 Solutions

  • CMPSC 461: Programming Language Concepts Assignment 1 Solution Problem 1 [6pt] Add parentheses to the following lambda terms so that the grouping of sub-terms becomes explicit. For example, the term λx. x λy. y with parentheses is λx. (x (λy. y)). a) (3pt) λx. λy. x y z Solution: λx. (λy. ((x y) z)) b) (3pt) λx. λy. (λx. x x) y λz. x z Solution: λx. (λy. (((λx. (x x)) y) (λz. (x z)))) Problem 2 [6pt] Fully evaluate the following λ-term so that no further β-reduction is ...
  • ExamsConnoisseur
    $8.49 Meer Info
CMPSC 461: Programming Language Concepts Assignment 4 Solutions
  • Tentamen (uitwerkingen)

    CMPSC 461: Programming Language Concepts Assignment 4 Solutions

  • CMPSC 461: Programming Language Concepts Assignment 4 Solution Problem 1 [5pt] Give an example in a programming language that you’re familiar with in which a variable is alive but not in scope. Solution: One example in C. After the function exists, the object that C links to is no longer in scope, but it is alive. 1 void foo() 2 { 3 myClass* C = new myClass(); 4 return; 5 } Problem 2 [10pt] Consider the following class instances in a C++ program: 1 static myClass A; 2 3 int main(...
  • ExamsConnoisseur
    $8.49 Meer Info
CMPSC 461: Programming Language Concepts Assignment 5 Solutions
  • Tentamen (uitwerkingen)

    CMPSC 461: Programming Language Concepts Assignment 5 Solutions

  • CMPSC 461: Programming Language Concepts Assignment 5 Solution Problem 1 [9pt] Consider the following C program: int SumOfSquares(int n) { if (n <= 0) return 0; else return n*n+SumOfSquares(n-1); } a) (5pt) Write down a tail recursive implementation of function SumOfSquares in C language. You can use helper function in your solution. Solution: int SumOfSquares(int n) { return SumOfSquaresHelp(0, n); } int SumOfSquaresHelp(int a, int n) { if (n <= 0) return a; else return...
  • ExamsConnoisseur
    $8.49 Meer Info
Programming Language Concepts CMPSC 461, FALL 2018 Midterm #1 Solutions
  • Tentamen (uitwerkingen)

    Programming Language Concepts CMPSC 461, FALL 2018 Midterm #1 Solutions

  • Programming Language Concepts CMPSC 461, FALL 2018 Midterm #1 Solution This exam is closed book, closed notes. You may not use any additional materials during the exam. All electronic devices must be put away. You may have nothing on your desk except this exam and writing instruments. The exam consists of 8 questions and 1 bonus question on 4 pages, totaling 100 points + 10 bonus points. Read each question carefully and use your time judiciously. The problems are not ordered by their dif...
  • ExamsConnoisseur
    $10.49 Meer Info
CMPSC 461: Programming Language Concepts Assignment 6 Solution
  • Tentamen (uitwerkingen)

    CMPSC 461: Programming Language Concepts Assignment 6 Solution

  • CMPSC 461: Programming Language Concepts Assignment 6 Solution Problem 1 [6pt] Assume that integers are stored using one byte in memory. What are the binaries for 8 and -10 in two’s complement format? What is the result of (8-10) in two’s complement format? Solution: binary for 8: binary for -10: result of (8-10): Problem 2 [10pt] Consider the following C declaration: union U1 {int a; float b;}; union U2 {char a; double b;}; struct S { union U1 u1; union U2 u2; } s; Assume ...
  • ExamsConnoisseur
    $8.49 Meer Info
Programming Language Concepts CMPSC 461, FALL 2018 Midterm #2 Solutions
  • Tentamen (uitwerkingen)

    Programming Language Concepts CMPSC 461, FALL 2018 Midterm #2 Solutions

  • Programming Language Concepts CMPSC 461, FALL 2018 Midterm #2 Solution P# Possible Score 1 8 2 10 3 16 4 8 5 24 6 16 7 10 8 8 Bonus 10 Total 110 This exam is closed book, closed notes. You may not use any additional materials during the exam. All electronic devices must be put away. You may have nothing on your desk except this exam and writing instruments. The exam consists of 8 questions and 1 bonus question on 5 pages, totaling 100 points + 10 bonus points. Read each questio...
  • ExamsConnoisseur
    $10.49 Meer Info
Programming Languages Concepts CMPSC 461, FALL 2016 Midterm #1 Solutions
  • Tentamen (uitwerkingen)

    Programming Languages Concepts CMPSC 461, FALL 2016 Midterm #1 Solutions

  • Programming Languages Concepts CMPSC 461, FALL 2016 Midterm #1 Solution This exam is closed book, closed notes. You may not use any additional materials during the exam. All electronic devices must be put away. You may have nothing on your desk except this exam and writing instruments. The exam consists of 8 questions and 1 bonus question on 6 pages, totaling 100 points + 10 bonus points. Read each question carefully and use your time judiciously. The problems are not ordered by their di...
  • ExamsConnoisseur
    $10.49 Meer Info
Wil jij je uitgaves terugverdienen?
Hoeveel heb je al uitgegeven op Stuvia? Stel je eens voor dat alle andere studenten JOU betalen voor je samenvatting. Ka-ching!