Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > IT форум > Помощь студентам
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 23.05.2015, 12:05   #1
zimno
Новичок
Джуниор
 
Регистрация: 23.05.2015
Сообщений: 1
По умолчанию Переделать из Borland C++ в Visual C++

Здравствуйте. Очень нужна помощь. В университете задали задание переделать программу, написанную на Borland
C++ в Visual C++. Не очень понятно, как его, это задание, выполнять, так как Borland-a мы никоим образом не касались.
Люди добрые, помогите, пожалуйста.

Вот код программы:

Код:

#include <dos.h>
#include <iostream.h>
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
class myCircle { 
public: int x; 
int y; 
int color; 
int radius; 
myCircle(int c);
~myCircle(); 
void turn_on(); 
void turn_off(); 
};
myCircle:: myCircle(int c) 
{
x=320; 
y=240;
radius=35;
color=c;
}
myCircle:: ~myCircle()
{
cout<<"\ndeleted "<<color;
}
void myCircle::turn_on() 
{
setcolor(color);
circle(x,y,radius);
setfillstyle(1,color);
floodfill(x,y,color);
}
void myCircle:: turn_off() 
{
setcolor(color-8);
circle(x,y,radius);
setfillstyle(1,color-8);
floodfill(x,y,color-8);
}
class myTimer { 
double myTime;
public: int x;
int y;
int color;
myTimer();
~myTimer();
void set(double t);
};
void myTimer:: set(double t) 
{
double x1, y1, del;
int m;
char s[20];
del=int(t/9.0);
or (m=9; m>=0; m--)
{
setcolor(WHITE);
itoa(m,s,10);
outtextxy(x-1,y,s);
delay(int(del));
setcolor(color);
outtextxy(x-1,y,s);
}
sound(440);
delay(50);
nosound();
}
myTimer:: myTimer() 
{
x=320;
y=240;
}
myTimer:: ~myTimer() 
{cout<<"\n deleted";
}
void main() 
{
int gdriver=DETECT, gmode, errorcode;
int z;
myCircle a1(LIGHTGREEN), a2(YELLOW), a3(LIGHTRED); 
myTimer tmr; 
initgraph(&gdriver, &gmode, "C:\\BC31\\bgi");
setbkcolor(DARKGRAY);
a1.y+=100; 
a3.y-=100;
a1.turn_on(); 
a2.turn_off();
a3.turn_off();
while(1)
{
tmr.y=a1.y;
tmr.color=a1.color;
tmr.set(10000);
for (int i=1; i<=5; i++)
{
delay(500);
a1.turn_on();
delay(500);
a1.turn_off();
}
a2.turn_on();
tmr.y=a2.y;
tmr.color=a2.color;
tmr.set(5000);
a2.turn_off();
a3.turn_on();
tmr.y=a3.y;
tmr.color=a3.color;
tmr.set(10000);
a2.turn_on();
tmr.y=a2.y;
tmr.color=a2.color;
tmr.set(5000);
a3.turn_off();
a2.turn_off();
a1.turn_on();
if (kbhit()) {z=getch(); if(z==32) break; else getch();}
}
closegraph();
}
zimno вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Из borland в visual studio narien Помощь студентам 2 08.01.2012 14:16
Microsoft Visual C++ VS Borland C++ Builder? VintProg Софт 53 28.08.2010 01:43
Переделать код с Visual C++ в Borland C++(3.1) 0001 Фриланс 5 06.02.2010 14:57
Помогите,как переделать текст проги Borland С++ Builder под Microsoft visual C++ 6.0 retpecub Visual C++ 9 15.06.2009 12:17
Visual C++ и Borland C++ Эдуард Visual C++ 4 20.02.2008 15:29