.... How to Find Your Subject Study Group & Join ....   .... Find Your Subject Study Group & Join ....

We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group)

[ + VU Study Groups Subject Code Wise ]  [ + COMSATS Virtual Campus Study Groups Subject Code Wise ]

Looking For Something at vustudents.ning.com?Search Here

# CS709 - Formal Methods for Software Engineering Assignment No. 2 Solution and Discussion Spring 2017 Due Date: May 27, 2017

CS709 - Formal Methods for Software Engineering Assignment No. 2 Solution and Discussion Spring 2017 Due Date: May 27, 2017

Question 1: Total Points (25)

Suppose there are b black, w white and r red tiles on a table. We are allowed to replace two tiles of different colors with the third color. Note one thing here that this third colored tile is from our pool containing infinite blackwhite and red tiles.

If we start replacing tiles, can we reach at a state where there is only one tile left on the table?

If YES, then how? and what will be the color of that last tile?

If NO, then why not?

You have to solve this problem with the help of pre-conditions, post-conditions and invariant.

[Example: Let’s say, there are three tiles (1 black, 1 white, 1 red) on the table.

If we pick two tiles (say 1 black and 1 white), we have to replace them with 1 red tile. Now there will be 2 red tiles on the table with no white or black tiles. ]

Question 2: Total Points (25)

Choose a programming language (either Java or C++) and explore Design by Contract (DbC) support in it. Implement Stack class along with its contract in Java or C++.

You have to submit the detailed procedure (with screen-shots) explaining how you have implemented the contract in Stack class and what happened when you violated the contract. Also submit the working code of Stack class along with its contract and detailed procedure of how to execute it.

Views: 116

### Replies to This Discussion

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Note:-

For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.

For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.

&

.... How to Find Your Subject Study Group & Join ....

admin sir please you provide the solution here as the date is expired i need just for stdy help

## Forum Categorizes

Job's & Careers (Latest Jobs)

Scholarship (Latest Scholarships)

Internship (Latest Internships)

::::::::::: More Categorizes :::::::::::

## Latest Activity

AQEEL AHMED and Hamza joined + M.Tariq Malik's group

### CS101 Introduction to Computing

15 minutes ago
Syeda liked Ali's discussion Kiya Aliens asli hotay hain? Zaroor Dekhain
19 minutes ago
52 minutes ago

### Little Girl ask very emotional question to her father | Very Heart touching | Smart Entertainment

57 minutes ago
Stranger posted a status
57 minutes ago
1 hour ago
AQEEL AHMED liked Ambreen Khalid's blog post While entering in Home
1 hour ago
AQEEL AHMED liked Ambreen Khalid's blog post How To say thank to Allah
1 hour ago

1

nill, Pakistan