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

  Explaining risk in fixed-price contracts

It is recognized that fixed-price contracts offer obvious advantages to buyer organizations because they transfer almost all of the risk to the contractor.

  Write shell script to read from keyboard-display on monitor

Write shell script called poject.21 to read from keyboard and display on monitor first name, last name and age if the age is less than 50.

  Ruby program that continuously reads in number

Write down Ruby program that continuously reads in number, x, from screen, and then calculates and displays its: factorial, if x is less than 15.

  Create unix shell script to input number of hours worked

Create a Unix shell script to input number of hours worked and pay rate and compute the total pay, then the social security amount (assume 5%), then the net pay.

  Write statement to call calculate interest method

Write the statement(s) necessary to call the calculate interest method with an account balance of $2300.00 and an interest rate of 5%.

  Write a paper on memory management

Write a paper on Memory Management

  Explaining class with no constructors

How many constructors can a class have? Can you have a class with no constructors? If a class has more than one constructor, which of them gets called?

  Write program using to take input two integers by while loop

Write a program which uses while loops to perform following steps: Prompts user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum).

  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.

  Cooks selected by methods are different which one is taller

He orders the shortest man in each column to step aside and chooses the tallest of these twenty-five. The two cooks chosen by the two methods are different. Which one is taller?

  Write bash script to copy file from one location to another

Write a bash script called mycopy that copies a file from one location to another. An example of running the script is given below.

  Write gui program as subclass of jframe

Write a GUI program as subclass of JFrame. It should contain the following: Labels At the top (column headings): Meal, Quantity, Cost, At the left: label for each mea.

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