📄 speed.cpp
字号:
/* Speedometer - Project
By: Debhy Bacamante
Cestonie Tampus
*/
#include <stdio.h>
#include <conio.h>
void speedometer();
void main()
{
clrscr();
speedometer();
getch();
}
void speedometer()
//{
// int cHour, Speed;
// printf("This Program will track the speed the car in\na series of time\n");
//getch();
//}
//int speedometer()
{
float cHour, a1,a2,a3,a4, a5, t;
float Vi, Vf, Vf1, Vf2;
float x;
int i;
//clrscr();
//Vi = 15.0;
printf("Please Input you Distance \n");
printf("Distance : ");
scanf("%f", &x);
printf("\n\n");
printf("Table: \n\n");
printf(" Time Speed(mph)\n");
printf("__________________________\n\n");
// a3=x;
for(i=40;i!=70+1;i++)
{
t=i/60.0/60.0;
Vi=15.0;
a1=Vi*t;
a2=t;
// a3=t/2.0;
a3=a2*a2;
a4=a1 + a3;
a5=a4/x;
// a6=a1+a3;
Vf1=Vi;
Vf2=a5*t;
Vf=Vf1+Vf2;
printf(" %ds - %.10f mph\n", i, Vf);
}
//getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -