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 do you understand by pre- and post-conditions of a function? Write the pre- and post-conditions...
What do you understand by pre- and post-conditions of a function? Write the pre- and post-conditions to axiomatically specify the following functions: (a) A function takes two floating point numbers representing the sides of a rectangle as input and returns the area of the corresponding rectangle as output. (b) A function accepts three integers in the range of -100 and +100 and determines the largest of the three integers. (c) A function takes an array of integers as input and...
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
Question 2: consider the following library relational database schema Write a program segment to retrieves the...
Question 2: consider the following library relational database schema Write a program segment to retrieves the list of books that became overdue yesterday and that prints the book title and borrower name for each. 1- Use JDBC with Java as the host language
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?
For the following causal difference equation, given that y[-1] = 2, y[-2] = 3, and x[n]...
For the following causal difference equation, given that y[-1] = 2, y[-2] = 3, and x[n] = 3nu[n], solve using z-Transforms. (Hint: convert to delay operator form, find the z-Transform, use PFE to find the inverse z-Transform) y[n + 2] – 3y[n + 1] + 2y[n] = x[n + 1]
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT