Formal Specification
Using Dafny language answer the following questions
Question 1: Write a method Max that takes two integer parameters and returns their maximum. Add appropriate annotations and make sure your code verifies.
Question 2: Write a test method that calls your Max method from Exercise 1 and then asserts something about the result.
Formal Specification Homework 3 10 Marks Using Dafny language answer the following questions Question 1: Write a method Max that takes two integer parameters and returns their maximum. Add appropriate annotations and make sure your code verifies. method Max(a: int, b: int) returns (c: int) // What postcondition should go here, so that the function operates as expected? // Hint: there are many ways to write this. { // fill in the code here } Question 2: Write a test method that calls your Max method from Exercise 1 and then asserts something about the result. method Max(a: int, b:int) returns (c: int) // Use your code from Exercise 0 method Testing() { // Assert some things about Max. Does it operate as you expect? // If it does not, can you think of a way to fix it? }
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.