Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

CS 326 - final exam Latest Update Actual Exam from Credible Source with 105 Questions and 100% Verified Detailed Correct Answers Guaranteed

Beoordeling
-
Verkocht
-
Pagina's
30
Cijfer
A+
Geüpload op
16-12-2024
Geschreven in
2024/2025

CS 326 - final exam Latest Update Actual Exam from Credible Source with 105 Questions and 100% Verified Detailed Correct Answers Guaranteed

Instelling
CS 326 -
Vak
CS 326 -

Voorbeeld van de inhoud

CS 326 - final exam Latest Update 2024-2025
Actual Exam from Credible Source with 105
Questions and 100% Verified Detailed Correct
Answers Guaranteed

<assign> -> <var> = <expression>


Define the LHS and RHS


ref ch3 - CORRECT ANSWER: LHS of arrow (->) is the abstraction being defined
RHS of arrow (->) is the definition of the LHS.


RHS consists of some mixture of tokens, lexemes, and references to other abstractions.
(Tokens are also abstractions)


A simple subprogram consists of two separate parts:


ref ch 10 - CORRECT ANSWER: The actual code of the subprogram, which is a
constant
The local variables and data listed previously which can change when the subprogram
is executed.


in the case of simple subprograms, both of these parts have fixed sizes.


A variable whose lifetime is that of a whole program is said to have "__________"


ref ch 9 - CORRECT ANSWER: unlimited extent -- this usually means they must be
heap dynamic rather than stack dynamic

,Calculate the precondition for 2 and 3 iterations of the loop. Generalize your answer.


while y <> x do
y=y+1
end
{y = x}
One Iteration:
wp(y = y + 1, {y = x}) {y = x - 1} - CORRECT ANSWER: Second Iteration:
wp(y = y + 1, {y = x -1} ) = { y + 1 = x - 1 }
or { y = x - 2}


Third Iteration:
wp( y = y + 1, { y = x - 2} ) = { y + 1 = x - 2 }
or { y = x - 3}


It is obvious that { y < x } will suffice for cases of one or more iterations, combining with {
y = x } for the zero iterations case we get { y <= x } which can be used as the loop
invariant.


The precondition for the while statement can be determined from the loop invariant.


For example


{y <= x and y <> x} y = y + 1 {y <= x}
Applying the assignment axiom to
y = y + 1 {y <= x}


we get {y + 1 <= x}, which is equivalent to {y < x}, which is implied by {y <= x and y <>
x}. So, the earlier statement is proven

, Can a wildcard be restricted?


ref ch 9 - CORRECT ANSWER: Yes -- as is the case with nonwildcard types. Such
types are called bounded wildcard types.


ie
Collection <?> c = new ArrayList();


//another example
public void drawAll(ArrayList<?> extends Shape> things)


The generic type here is a wildcard type that is a subclass of the Shape class.
This method could be written to draw any object whose type is a subclass of Shape.


Can nonterminal symbols have two or more distinct definitions representing two or more
possible syntactic forms in the language?


ref ch 3 - CORRECT ANSWER: Yes. Multiple definitions can be written as a single rule,
with the different definitions separated by the symbol.


Compute the conditions across branches
if x > 0 then
y=y-1
else
y=y+1
{y > 0}
ref lec slides Axiomatic Semantics Pt2 - CORRECT ANSWER: First the "then" clause:
y = y - 1 {y > 0}

Geschreven voor

Instelling
CS 326 -
Vak
CS 326 -

Documentinformatie

Geüpload op
16 december 2024
Aantal pagina's
30
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$20.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
Tutordiligent Chamberlain College Of Nursng
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
609
Lid sinds
3 jaar
Aantal volgers
219
Documenten
8369
Laatst verkocht
2 weken geleden
Tutordiligent

Tutordiligent is a Medical Professional with a Bachelor of Medicine and Bachelor of Surgery (MBBS) from Chamberlain College of Nursing of Health Sciences. His academic journey included internships in Radiology, Cardiology, and Neurosurgery. His contributions to medical research extend to two publications in medical journals, solidifying his position as a promising addition to the field.

3.6

94 beoordelingen

5
35
4
19
3
22
2
3
1
15

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen