How to complete input assertion and output assertion

Assignment Help Programming Languages
Reference no: EM1369563

Consider the game for "pass/fail"

A student decided to speed up the play by modifying the rules. He suggests that for each round of the game a student would take out five coins and return back only one. The rules given were incomplete:

1.a Invent game rules for a game that begins with any number of coins.
{ }
use rules
Take out 5
Put back 1
{ }

1.b Complete the input assertion and output assertion that will guarantee ONLY that the game will always terminate (does not matter if the student ends guilty or innocent). Add only assertions and invariants that can help you reason about termination.

1.c Complete the input assertion and output assertion that will guarantee that the student always ends the game passing the class. Add assertions and invariants that can help you reason about your claim.

1.d Complete the input assertion and output assertion that will guarantee that the student is never fail the class (hint- this is NOT the same as 1.c) Add only assertions and invariants that can help you reason about partial correctness.

Reference no: EM1369563

Questions Cloud

Explain relationship between privacy and it : Explain the relationship between privacy and IT. Describe some of the threats to information security and some of the measures you can take to protect information resources.
Fed buys securities in the open market : Below are events that might affect supply of money, the demand for money, or the interest rate. Explain how each event may affect these three economic variables.
What alpha do investors in davitas fund : What alpha do investors in Davita's fund expect to receive and how much money will Davita have under managerment?
What cost curves if any does this tax affect : Government says that firm X must pay $1000 in taxes simply because it is in business of producing a good. What cost curves if any does this tax affect and does MC change if TC changes.
How to complete input assertion and output assertion : Complete input assertion and output assertion which will guarantee that student always ends game passing class. Add assertions and invariants which can help reason about claim.
Find profit-maximizing choice of q for smith : Write down an expression π(q ) for profits as a function of q. Find profit-maximizing choice of q for Smith and corresponding price and profit.
Show the primary data collection method : Develop three, related research questions you would like to answer for your work situation and show one primary data collection method you would choose to answer the questions.
Computing the equilibrium price : In 2008, box industry was perfectly competitive. The lowest point on long run average cost curve of each of the identical box producers was $4,
Assume that the service rate to a waiting line system : Assume that the service rate to a waiting line system is 10 customers per hour (exponentially distributed). Analyze how the average waiting time is expected to change

Reviews

Write a Review

Programming Languages Questions & Answers

  Design program to compute-display number of miles per hour

Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing.

  Program to solve roots of quadratic equation

Write down a program which solves the roots of the quadratic equation of the given form:- ax 2 + bx + c = 0. Display the results on screen.

  Write program to accept data for each student

Write a program that accepts data for each student in the school - Student ID, classroom number, and score on the achievement test. Design a program that lists the total points scored for each of the 30 classrooms.

  Explain some ways tables can be used on web page

Tables are one of the most useful page layout tools available to web designers. Explain some ways tables can be used on a web page. Elaborate on other ways to achieve the same look.

  Program to read an employee-s number from keyboard

Write a program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

  Statement to read variables of type double

Suppose two variables p1 and p2 of type POINT, with two fields, x and y, both of type double, have been declared. Write a statement that reads values for p1 and p2 in that order.

  Php code to add-delete product using ajax programming

PHP Code to add a new product and delete a existing product Implement AJAX Programming based solutions to write code to add a new product to the database.

  Write program to list all english-math and science teachers

Suppose that input consists of a file of teachers. You are told to write a program to list all English, math, and science teachers. Each teacher can teach only one subject.

  What is java adapter class

What is Java adapter class.

  Write program to allow two users to play tic-tac-toe

Write a program that will allow two users to play tic-tac-toe. The program should ask for moves alternately from player X and player O.

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Program to processes the test data

Write a program that processes the test data. The output should be the student's ID, followed by the answers, followed by the test score, and followed by the test grade.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd