Not sure if I should put this here or creations, but ohwell.
This is a military time converter. Enter a military time like 23 and it will tell you the am/pm time of that.
For the most part this is done, but I'm gonna add looping. Also I'm trying to find a way to make a am/pm to military time converter, but that's gonna be tough wil the am/pm difference. But I think I can do it.
Anyway here's the program. :D
| CODE |
/////////////////////////// /// Military Time Converter /// Created by Shadow382 /// October 29, 2005 //////////////////////////
#include<iostream> using namespace std;
float militime, regtime; string answer;
int main() { cout<<"***************************"<<endl; cout<<"* Military Time Converter *"<<endl; cout<<"***************************"<<endl; cout<<" By Shadow382!\n"<<endl; cout<<"Enter time in military format: "; cin>>militime; if (militime > 12) { regtime=militime-12; } else { regtime=militime-0; } cout<<"\nThe am/pm time of "<<militime<<"00hrs is "<<regtime<<""; if (militime > 12) { cout<<"pm!\n"<<endl; } else { cout<<"am!\n"<<endl; } system("pause"); } |
I'm gonna make a program with alot of mini-programs in it. This will be one of them, aswell as my calculator. Just gotta make enough before I can start of the main program. :P
Lemme know if anything needs to be fixed. ;)
-Shadow382
Everybody is into calculators these days O.o... Why not something else...?
Because math with C++ is the first thing they teach you in C++ tutorials/books.
They would teach you math stuff like how to make S H I T go to reverse. Now THAT shows you grasped good math concepts. But CALCULATORS :s?
I've never heard it called military time before - the 24h clock sounds friendlier...