Question

In: Computer Science

Given the following pre-condition and program segment, what is the post-condition for y? // Pre-condition: -2...

Given the following pre-condition and program segment, what is the post-condition for y?

// Pre-condition: -2 <= x < 4

y = 2*x*x - x +3

Solutions

Expert Solution

post condition for y will be :

for x = -2 , y = 2*-2*-2 - -2 +3 = 13

for x = 4 , y = 2*4*4 - 4+3 = 15

hence y will be 13<= y < 15


Related Solutions

What is the pre-condition for x, if the post-condition is -30 <= y <= 0 for...
What is the pre-condition for x, if the post-condition is -30 <= y <= 0 for the following program segment? y = x * x - 5 *x - 24
What is a Pre-test? Explain. What is a Post-test? Explain. Write a one to two (1–2)...
What is a Pre-test? Explain. What is a Post-test? Explain. Write a one to two (1–2) page paper in which you answer the questions about distribution sampling
a) Let y be the solution of the equation  y ′ = (y/x)+1+(y^2/x^2) satisfying the condition  y (...
a) Let y be the solution of the equation  y ′ = (y/x)+1+(y^2/x^2) satisfying the condition  y ( 1 ) = 0. Find the value of the function  f ( x ) = (y ( x ))/x at  x = e^(pi/4) . b) Let y be the solution of the equation  y ′ = (y/x) − (y^2/x^2) satisfying the condition  y ( 1 ) = 1. Find the value of the function  f ( x ) = x/(y(x)) at  x = e  . c) Let y be the solution...
given the logistics equation y'=9(1-y)y on the interval [0,5], w/ initial condition y(0)=1.25 1. what are...
given the logistics equation y'=9(1-y)y on the interval [0,5], w/ initial condition y(0)=1.25 1. what are the equilibrium Solutions? What is the long-term behavior of the solution? 2. solve the ode exactly and plot the solution on [0,5]. given the ivp y'=-y^2 on the interval [0,2] with initial condition y(0)=-1/2 1. solve the ode. what is the behavior of the true solution as x approaches 2?
WHAT IS the pre-test, tutorial and post-test for the following 3 skills modules: • Enteral Tube...
WHAT IS the pre-test, tutorial and post-test for the following 3 skills modules: • Enteral Tube Feedings • Vital Signs • Urinary Catheter Care
under what condition is erythroblastosis fetalis? why is the condition given this name?
under what condition is erythroblastosis fetalis? why is the condition given this name?
Using C Language Write a program segment that computes 1 + 2 + 3 + ......
Using C Language Write a program segment that computes 1 + 2 + 3 + ... + ( n - 1) + n , where n is a data value. Follow the loop body with an if statement that compares this value to (n * (n + 1)) / 2 and displays a message that indicates whether the values are the same or different. Please give me code to just copy and paste
What is the notice given to the buyer by the seller concerningthe condition of a...
What is the notice given to the buyer by the seller concerning the condition of a property called?A. Seller's Disclosure NoticeB. Seller's Defects NoticeC. Seller's Lien NoticeD. Seller’s Disclaimer Notice
Pre and Post-operative Nursing The following question relate to a 56 years old man with a...
Pre and Post-operative Nursing The following question relate to a 56 years old man with a History of Diabetes, HT and smoking. They are having a R) Below Knee Amputation (BKA). 12.1)   What psychological challenges are likely for a BKA? (15 -30 words) 12.2)   List 4(four) pre-operative nursing interventions 12.3)   List 4(four) post-operative nursing interventions for a client with Below Knee Amputation
What does it mean when a stroke involves the entire pre and post central guri on...
What does it mean when a stroke involves the entire pre and post central guri on the left side of the brain? What I mean is the cause of the stroke in this situation. Thanks.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT