Question

Hey, could someone help me check my answers with these please :) Thank you

Which of the following does the choice rule not allow you to do? Take any pre-condition of the if: construction as a pre-cond

In order to use a the loop rule, we must idendify some assertion (P) which: is independent of the truth of the condition in t

The predicate x 2 0 is: not suitable for use as a loop invariant an invariant of the block of code, given y 2 0 an invariant

Which of the following does the choice rule not allow you to do? Take any pre-condition of the if: construction as a pre-condition of the if: and else: blocks Take the condition of the if statement a a pre-condition of the if: block Take (P) as a post-condition of the whole if: construction if (Py is a post-condition of both the if: and else: blocks Take the condition of the if statement as a pre-condition of the else: block
In order to use a the loop rule, we must idendify some assertion (P) which: is independent of the truth of the condition in the while: statement is a pre-condition of the loop and an invariant of the body of the loop is a pre-condition of the loop. is an invariant of the body of the loop.
The predicate x 2 0 is: not suitable for use as a loop invariant an invariant of the block of code, given y 2 0 an invariant of the block of code not an invariant of the block of code
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Take--the -condition of the estalernent a pre - conol hun of he elhe as c btock 5 easen ascvdung b loop rule 9 an in vodant

Add a comment
Know the answer?
Add Answer to:
Which of the following does the choice rule not allow you to do? Take any pre-condition of the if...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The Heaviside step function is a mathematical function defined by h(x) := ( 1 : x ≥ 0 0 : x < ...

    The Heaviside step function is a mathematical function defined by h(x) := ( 1 : x ≥ 0 0 : x < 0 that is to say, h(x) is 1 for non-negative x and 0 for negative x. In this question we will prove that the following code computes h(x) if (x >= 0): y = 1 else: y = 0 a) Define a predicate p(x, y), written solely in terms of logical ANDs and ORs, inequalities and equalities, which...

  • Programming Assignment #2 EE 2372 MAKE SURE TO FOLLOW INSTRUCTIONS CAREFULLY, IF YOU HAVE ANY DOUBTS...

    Programming Assignment #2 EE 2372 MAKE SURE TO FOLLOW INSTRUCTIONS CAREFULLY, IF YOU HAVE ANY DOUBTS PLEASE EMAIL ME! This programming assignment will just be a small extension to programming assignment 1. In the first assignment each of the functions could only take a predefined number of inputs. This time the objective is to be able to complete these functions with any amount of inputs. The user will pass arguments through the command line (this means you will have to...

  • Lab 4: Java Fundamentals, Part IV In this assignment, you solve a conversion problem similar to...

    Lab 4: Java Fundamentals, Part IV In this assignment, you solve a conversion problem similar to Programming Challenge 1 of Chapter 3 of your text, page 184 (187 in Edition 5). Given one of the Roman numerals I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV as an input your program must determine and display the corresponding decimal digit 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15....

  • LANGUAGE IS C++ Lab Ch14 Recursion In this lab, you are provided with startup code which...

    LANGUAGE IS C++ Lab Ch14 Recursion In this lab, you are provided with startup code which has six working functions that use looping (for, while, or do loops) to repeat the same set of statements multiple times. You will create six equivalent functions that use recursion instead of looping. Although looping and recursion can be interchanged, for many problems, recursion is easier and more elegant. Like loops, recursion must ALWAYS contain a condition; otherwise, you have an infinite recursion (or...

  • C LANGUAGE. PLEASE INCLUDE COMMENTS :) >>>>TheCafe V2.c<<<< #include ...

    C LANGUAGE. PLEASE INCLUDE COMMENTS :) >>>>TheCafe V2.c<<<< #include <stdio.h> int main() { int fries; // A flag denoting whether they want fries or not. char bacon; // A character for storing their bacon preference. double cost = 0.0; // The total cost of their meal, initialized to start at 0.0 int choice; // A variable new to version 2, choice is an int that will store the // user's menu choice. It will also serve as our loop control...

  • Could someone please help me write this in Python? If time allows, it you could include...

    Could someone please help me write this in Python? If time allows, it you could include comments for your logic that would be of great help. This problem involves writing a program to analyze historical win-loss data for a single season of Division I NCAA women's basketball teams and compute from this the win ratio for each team as well as the conference(s) with the highest average win ratio. Background Whether it's football, basketball, lacrosse, or any other number of...

  • 1. According to the paper, what does lactate dehydrogenase (LDH) do and what does it allow...

    1. According to the paper, what does lactate dehydrogenase (LDH) do and what does it allow to happen within the myofiber? (5 points) 2. According to the paper, what is the major disadvantage of relying on glycolysis during high-intensity exercise? (5 points) 3. Using Figure 1 in the paper, briefly describe the different sources of ATP production at 50% versus 90% AND explain whether you believe this depiction of ATP production applies to a Type IIX myofiber in a human....

  • **TStack.py below** # CMPT 145: Linear ADTs # Defines the Stack ADT # # A stack (also called a pushdown or LIFO stack)...

    **TStack.py below** # CMPT 145: Linear ADTs # Defines the Stack ADT # # A stack (also called a pushdown or LIFO stack) is a compound # data structure in which the data values are ordered according # to the LIFO (last-in first-out) protocol. # # Implementation: # This implementation was designed to point out when ADT operations are # used incorrectly. def create(): """ Purpose creates an empty stack Return an empty stack """ return '__Stack__',list() def is_empty(stack): """...

  • For this week's lab, you will use two of the classes in the Java Collection Framework:...

    For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. Set Methods For this lab, you will need to use some of the methods that are defined in the Set interface. Recall that if set is a Set, then the following methods are defined: set.size() -- Returns the number of items in the set. set.add(item) -- Adds the item to the...

  • pleas help me in this do any question you know using National Electrical Code 2011 Applied Electricity NEC...

    pleas help me in this do any question you know using National Electrical Code 2011 Applied Electricity NEC worksheet t hree Copper conductors with THHN insulation run in Electrical A branch-circuit Consther conductors. The conductor terminations are rated for a maximum ure in the area of this installation is not expected to exceed 30C size 8 AWG, the maximum ampacity of the conductors If the conductors for this circuit are permitted A 40 amperes. B. 50 amperes. to be used...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT