Find out the data that you will have in the program

Assignment Help C/C++ Programming
Reference no: EM131369800

ASSIGNMENT

A good first step when creating a computer program is to start the detailed design process using pen and paper. With this in mind, write out the following:

• List all the steps in Tetris.
• Find out the data (e.g. a bucket, etc.) that you will have in the program.
• Find out what are the data structures you need to use to store those data.
• Find out the actions that your program needs for the game. All the actions will be functions.
• Come up with the sequence how you would call functions from the main function, inside the game loop, and from inside other functions.

Remember, you will do all of this with a pen and a paper before you write any code on the computer.

Now take your hand-written detailed design and create your C++ program. In the program, you will have:

• All the data structures (e.g., bucket, shape array, etc.) declared
• The function declarations and empty body implementations
• The functions being called in the "main" function and from any other functions

Refer to your hand-written notes and include them as comments in your program. Describe your program with tons of comments, especially for all the function implementations for the game loop.

Put a display in your functions that would say which function it is in, e.g., "In moveShape." To slow down the program, you can slow it down with "sleep".

Remember, you are using blank or empty calling functions, as in:

/* Add comments at the top of the program describing what this program is about. You can provide example input and output of program if applicable.*/

// Gets the input from the user.

bool getUserInput() {

cout << "In getUserInput function" << endl;

sleep(500);

}
// Finds the key is pressed.

// Then, calls the appropriate function to move the shape

void moveShape (char input) {
cout << "In moveShape function" << endl;

sleep(500);
// You might have a switch case or something to find which key is pressed.
//Then, in each case call the appropriate function, like below.

moveShapeLeft();
}
/* The main function where all the actions start. */

int main(){
while(!gameOver) {

//(1) Gets the user input.

key = getUserInput();

//(2) Displays the bucket.

//(3) Moves the shape

moveShape(key);

....

....

....

}

}

This is just an example. You need to come up with your own game loop and dummy functions.

The aim is to see that you have the game loop under control. Work on it until it runs well through the correct sequence of events.

Reference no: EM131369800

Questions Cloud

Training development and performance management-appraisals : Training development and performance management & appraisals. We will review the vast importance of impactful training and development of an organization's existing employee network. As organizations face more and more competition and change, trainin..
What is the difference between the two versions of the game : Conceptually, what is the difference between the two versions of the game? Is there any practical difference between the two versions as far as a player is concerned?
Capacity requirements planning includes planning : Capacity requirements planning includes planning the following resources:
Issuing respiratory protection : Employers are required to put engineering and administrative controls in place before issuing respiratory protection. Should this hierarchy of controls be required, or should employers be able to skip controls and go straight to respirators? Why is i..
Find out the data that you will have in the program : Find out the data that you will have in the program. Find out what are the data structures you need to use to store those data. Find out the actions that your program needs for the game. All the actions will be functions.
How many possibilities are there in order of selection : An oil company can only afford to drill at eight sites, sequentially chosen. How many possibilities are there, in order of selection?
A deculturation strategy of merging two corporate cultures : A deculturation strategy of merging two corporate cultures should be applied:
Demand considerations for over-the-road transportation : Conduct research that will enable you to compare and contrast supply and demand considerations for over-the-road transportation. Summarize your thoughts in a MS Word (or similar application) document. Your answer should be at least 500 words in lengt..
How many possible ordered choices of 3 out of 6 candidates : A committee is evaluating six equally qualified candidates for a job.- How many possible ordered choices of three out of six candidates are there?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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