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

  Program to match exam score to a letter grade

Create algorithm which will prompt the operator for student's serial number and student's exam score out of 100. Your program is then to match exam score to a letter grade.

  Program to compute grade point average

Write a program that uses such a file to calculate your grade point average(GPA). A GPA is based on a scale from 5, where A is 4, B is 3, C is 2, D is 1 and F is 0.

  Program to generate a random number between a range

Write down a program to generate random number between 1 and 100 and asks user to guess what number is.

  Program to display contents of file in separate line

Display the contents of the file GRADES created in Problem 1. Each student's record should appear on a separate line and include the total score (the sum of the three tests) for that student.

  Write a program that will generate an array

Write a program that will generate an array

  Characteristics used for biometric user authentication

You have just been promoted to manager of computer security for large enterprise (XYZ Corporation). Your first project as security manager is to estimate principal physical characteristics used for biometric user authentication.

  Create new method public to create and return new picture

Create a new method public Picture frame (int frameSize, Color frameColor) this method will create and return a new picture object.

  Program calculate average number of days employee are absent

Write a program that calculates the average number of days a company's employees are absent. The program should have the following functions: a function called main that asks the user for the number of employees.

  Distinguish class templates and program with heading

Clearly distinguish each class templates and their program with heading. Elaborate each step and give it without errors. Develop classes or class templates for the following.

  Application to convert kilometers in miles

Application will input number of kilometers, compute number of miles, and display number of miles. You will use a constant to store the kilometers-to-miles conversion factor.

  Write a bash shell script prompt user to enter first name

Write a Bash shell script named phone.bsh that prompts the user the to enter first or last or any portion of person's name, so that can be found the appropriate entry in the phone directory file.

  Create script which checks day of the week

Create a script which checks day of the week, and takes one of two actions (step 2 or 3) depending on the day. If day is Monday through Friday, print (send to stdout) name of the day.

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