Let P be a program component that reads a list of TV records and a range conditi
ID: 3829767 • Letter: L
Question
Let P be a program component that reads a list of TV records and a range condition on the record key. The first seven characters of the record from the record key P reads the key and produces an output file that contains only those whose key falls in the prescribed range. For example, if the range is “JONES” to “SMITH” then the output file consists of all records whose keys are lexicographically between “JONES” and “SMITH” Write the input and output conditions as assertions to be used in proving P correct. Write a flow diagram of what P’s logical flow might be and identify the transformation points. Approach, a modified top-down approach, a big-bang approach, a sandwich approach, and a modified sandwich approach.
Explanation / Answer
Answer is Here :
A: (P is an array) & (size(P) = N) & (lower<upper)
Aend : (P is an array) & (size(P’) N) & (I in 1, … , size (P’), P’(i) lower & P’(i) <= upper &j in , … , N, P(j) = P’(i)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.