News Latest Technology, How to Fix Apple iPhone, contrast and brightness, Wireless Headphone, android KitKat stock firmware, XiaoMi Mi Pad, Tracfone Promo

Senin, 20 Mei 2013

HOW TO SIMULATE A BOUNCING BALL USING C++

HOW TO SIMULATE A BOUNCING BALL USING C++ - with more and more gadgets of new products, we should be literate technology because the product is made with the purpose to further facilitate our lives, on the blog News Latest Technology we will discuss about new and old products, we will explain the full pungsi, well now we will first clean up about HOW TO SIMULATE A BOUNCING BALL USING C++ we have collected a lot of data to make this article so you do not deleted information. please see:

Articles : HOW TO SIMULATE A BOUNCING BALL USING C++
full Link : HOW TO SIMULATE A BOUNCING BALL USING C++
Article C++, Article How to, Article programming,

You can also see our article on:


HOW TO SIMULATE A BOUNCING BALL USING C++

HEllo!!
Bouncing ball simulation is really interesting in C++. It uses the header file <graphics.h> for drawing the ball, and here we also use http://memesmemosos.blogspot.com /2013/05/using-delay-function-in-c.html">the delay function for displaying the ball in different places.
The header files used : < graphics.h> , <stdio.h>, <conio.h> , <iostream.h>, <dos.h>, <stdlib.h>
the source code is not that hard to understand if you know how to use graphics in C++.
Otherwise it's a little complicated, again 'copy-paste'.


here is the source code:

#include<stdio.h>
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
int n = 200,x = 50, y = 50, r=30;
void move()
{
setcolor(GREEN);
circle(x,y,r);
delay(70);
setcolor(BLACK);
setfillstyle(1,BLACK);
circle(x,y,r);
floodfill(x,y,BLACK);
delay(50);
putpixel(x,y,8);
return;
}
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\tc\BGI");
while(n>0)
{
while(y<450)
{
move();
y = y+25;
x=x+5;
putpixel(x,y,8);
} while (y>n)
{ move();
y=y-25;
x=x+5;
putpixel(x,y,8);
} n=n+50;
}setcolor(GREEN);
circle(x,y,r);
getch();
closegraph();
}
view raw gistfile1.cpp hosted with ❤ by GitHub


That's it, there is nothing you can do in this simulator, other than watching it bounce.

Thank you
cheers !!
keep coding..





quite so many infromation HOW TO SIMULATE A BOUNCING BALL USING C++

hopefully the information we provide about HOW TO SIMULATE A BOUNCING BALL USING C++ we provide can be useful for your life especially in determining the gadget according to your requirement.

just smell you finished reading the article about HOW TO SIMULATE A BOUNCING BALL USING C++ if intend to share or just bookmark please use link https://memesmemosos.blogspot.com/2013/05/how-to-simulate-bouncing-ball-using-c.html to get more information about gadget please visit other pages on this blog that we guarantee super complete.

Tag : , , ,
Share on Facebook
Share on Twitter
Share on Google+

Related : HOW TO SIMULATE A BOUNCING BALL USING C++

  • Another Airtel Free 1GB Data Offer For One MonthHi, Guys do you know the Airtel Imei tweaking is still going on, you can get 1GB for free on Airtel. Several ways to get data and surf the internet, chat with your pals ...
  • C# Program to check entered value is character, integer or special symbolC# Program to check entered value is character, integer or special symbolProgram Statement:Write a program which takes one value from user and check whether the entered ...
  • How to change IP addressPeople want to change  IP address for a variety of reasons. The Internet Protocol (IP) address is popularly known as the IP address. This private address is used by ...
  • How to become a Computer ProgrammerComputer programming, also known as programming, coding, or software development (there are subtle differences between each term), is the process of “writing instruction ...
  • tsu - Get Paid To PostThe Most Promising Social Network.Other social sites like Facebook and Twitter won't give you this kind of perks.How to register on tsu? There is no direct registration ...

0 komentar:

Posting Komentar