Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

VC++ Game of Chance Lab Exercise, Exercises of Advanced Computer Programming

A lab exercise for creating a console application in vc++ using microsoft visual studio 2003. The program should display a welcome screen, rules, and allow the user to play a 'game of chance' where they press 'r' to generate random numbers and calculate scores, sums, and products. After 10 chances, the user is informed if they won or lost and given the option to replay. Bonus marks are given for optimal code, error checking, and proper indentation and commenting.

Typology: Exercises

2011/2012

Uploaded on 07/24/2012

omni
omni 🇮🇳

4.6

(9)

46 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Programming-II Lab Exercise 4.
Problem Statement:
In this assignment you have to write a Console application in VC++ using Microsoft Visual
Studio 2003. Your program should do the following things.
In this assignment you have to write a program for a game called “Game of chance”. Upon
execution your program should show a welcome screen to the user as follows.
After user presses enter following screen should be displayed showing the rules of the game.
After that user presses any key the game should start. Every time the user presses three random
numbers should be generated and displayed on the screen with the scores. Also the sum and
product of the numbers should be displayed.
When the user presses ‘r’ again the previous screen should get cleared and new random number
along with their score, sum and product should be displayed. A sample is in the following figure.
docsity.com
pf2

Partial preview of the text

Download VC++ Game of Chance Lab Exercise and more Exercises Advanced Computer Programming in PDF only on Docsity!

Programming-II Lab Exercise 4.

Problem Statement: In this assignment you have to write a Console application in VC++ using Microsoft Visual Studio 2003. Your program should do the following things. In this assignment you have to write a program for a game called “Game of chance”. Upon execution your program should show a welcome screen to the user as follows.

After user presses enter following screen should be displayed showing the rules of the game.

After that user presses any key the game should start. Every time the user presses three random numbers should be generated and displayed on the screen with the scores. Also the sum and product of the numbers should be displayed. When the user presses ‘r’ again the previous screen should get cleared and new random number along with their score, sum and product should be displayed. A sample is in the following figure.

docsity.com

After completion of all the 10 chances the screen should be cleared and user should be displayed the appropriate message either he won or lost the game, with the option to replay the game.

You may add some additional functionality in this game this part carry 2 points.

Instructions:

  1. Bonus marks for optimal code and error checking/ handling.
  2. Code should be indented properly.
  3. Code should be commented but not in such a way that it would be difficult to find the actual code from the commenting.

Submission Guidelines:

  1. ZERO credit for assignments submitted after 12th^ February 2008 11:00 AM.
  2. Submit your assignment in submission folder \margala\Prog-II_SecH_lab \Assignments\Assignment 2 Submission
  3. Name of the folder should be Roll-No_ LA-4. For example 07-0361_LA-4.

docsity.com