- Code: Select all
@echo OFF
color a0
title Time Card
set start=1
cls
GOTO start
:start
if "%start%"=="2" (GOTO add) else GOTO first
:first
set /p hour=ENTER HOUR:
if "%hour%"=="1" GOTO one
if "%hour%"=="2" GOTO two
if "%hour%"=="3" GOTO three
if "%hour%"=="4" GOTO four
if "%hour%"=="5" GOTO five
if "%hour%"=="6" GOTO six
else GOTO addhours
:: Convert to Military Time
:one
set hour=13
GOTO addhours
:two
set hour=14
GOTO addhours
:three
set hour=15
GOTO addhours
:four
set hour=16
GOTO addhours
:five
set hour=17
GOTO addhours
:six
set hour=18
GOTO addhours
:: Convert hours and get minutes
:addhours
set /a hoursmin= %hour% * 60
set /p minutes=ENTER MINUTE:
set /a total1= %hoursmin% + %minutes%
set /a start=%start% + 1
GOTO start
::Second Time Around
:add
set /p hour=ENTER HOUR:
if "%hour%"=="1" GOTO one1
if "%hour%"=="2" GOTO two2
if "%hour%"=="3" GOTO three3
if "%hour%"=="4" GOTO four4
if "%hour%"=="5" GOTO five5
if "%hour%"=="6" GOTO six6
else GOTO addhours
:one1
set hour=13
GOTO addhours1
:two2
set hour=14
GOTO addhours1
:three3
set hour=15
GOTO addhours1
:four4
set hour=16
GOTO addhours1
:five5
set hour=17
GOTO addhours1
:six6
set hour=18
GOTO addhours1
:: Convert hours and get minutes
:addhours1
set /a hoursmin= %hour% * 60
set /p minutes=ENTER MINUTE:
set /a total2= %hoursmin% + %minutes%
set /a total1=%total1% + %total2%
echo YOU'VE WORKED %total1% MINUTES
GOTO start
If someone could help me figure this out I would be so grateful!