I am doing a school project. The project basically is that it records the in and out time of an employee(of an particular company).The employee while checking in or out should enter a unique key generated specially for him so that no one else can check in and out for him.Then referring to the employees position( A worker or a manager or something like that) his total working time each day , for a week and a month is calculated. The company starts at 8 am and ends at 5 pm for 1st shift and for second shift from 3.30 pm to 2.30 am. Plus Saturday and Sunday off. Then after a month the program refers to the working time date stored in a file and calculates his pay(For workers its per hour salary and for managers it aint).
If an employee is consistently late the details are forwarded to the HR account( so that necessary steps are taken).This will support the company log the details of their employees duty time plus give enough detail to take action if someones always late. I'm doing this as a school project and it needn't be of enterprise class and all.. But i want the coding to perform as it should. Also i'm forced to use the old Turbo C++. Now i'm struck in the place where the time of the employees in and out time is logged. This coding does the work
Code: void main( ) { clrscr(); char dateStr [9],timeStr [9]; _strdate( dateStr); cout<<" The current date is "<<dateStr<<'
[Code] ....
I think the second one is better as it not only gives me date but also gives me the day so i can check easily for the weekends. So, how these time functions work.
I have an extra credit project where I'm supposed to calculate an approximate the user's age based on the current date and their birthday. My problem is that I am not getting the proper date and time. C++ keeps giving me some random date. I looked up c++ time format on the internet because this is extra credit and not in my book.
I am currently using dev C++ 4.9.9.2. Here is my current code :
// included libraries #include <cstdlib> #include <iostream> #include <iomanip> #include <time.h> #define cls system("cls") #define pauseOutput system("pause") void printM(int x); void age(int m, int d, int y, int &yearAge, int &monthAge, int &dayAge);
I have an assignment in which i must create a program which prompts for user input of current and birth date, which will compare said dates and output if its your birthday or not. I've completed a large portion of it, but cannot figure out how to get the user input of month as an integer such a 2 into February.
#include <iostream> using namespace std; class DayOfYear { public: void input();
When I step into CMainFrame::OnAlohaHowAreYou(), I found m_pDoc is NULL. If I remove the split views and make CMainFrame::OnCreateClient() like below, then there is no problem.
I'm trying to write a program that uses the Boost library to input a string date in the format mm/dd/year and outputs to the string its corresponding day of the week. I wrote the program that I thought would accomplish this, but it doesn't seem to work. Below is the code I wrote:
When I compile this using codeblocks it gives me the error "In function `ZN5boost9date_time19month_str_to_ushortINS_9gregorian10greg_monthEEEtRKSs':| C:Users osaDesktop est3........Liboost_1_55_0oostdate_timedate_parsing.hpp|67|undefined reference to `boost::gregorian::greg_month::get_month_map_ptr()'". And it takes me to the file date_parsing.hpp and highlights line 67. I don't understand why this isn't working.
i'm making a program that, given a person's birthdate or any other date, will display the day of the week of the person was born.
There is this part where it says "use a switch statement to make this calculation, If desired month is 12, add the number of days for November, if desired month is 11 add the number of days for october....
So it's suppose to start with "case 12 :...
I can't figure out what to write for the statement....
I have two date/time structures which I'm populating, but when I populate the second one it sets the same values in the first. This is what I've got so far
Im doing a little game, casting dices etc. The problem is that the program will ask for player 1 then if i enter a name and enter it will ask for player two and so going on until i just press enter with a empty field and then continue the game.
The problem is i don't have any clue what code bits to start studying and how i shall lay it up, feels like i need a new string declaration automatically for each name.
void replace(string oldstring, string newstring) { int stroldstringpos=b.find(oldstring); b.replace(stroldstringpos,newstring.length(),newstring); }
i have 1 error in these function that i'm confused. imagine the newstring size is more big than the oldstring, how can change the string, but only change the oldstring and add what left? see these:
I am making a program that formats a string. I want to create a new 2 dimensional string that will have many other chars and strings in it beside the original string. Then I split the string up on the newlines and return it. Adding different parts to the 2d string e.g. I need to add five _ as chars not string then I need to add different things. First I use sprintf () to add as much as possible. And then I do what to add the rest?
Also is there a way to display the time only instead of the date? How will i change the program to display the time in standard 12 hours, instead of 24 hours?
#include <iostream> #include <time.h> using namespace std; int main() { time_t tim; time(&tim); cout << ctime(&tim); }
I've been wondering if there's a function or procedure used to know the current video mode. An example of how this was done in Pascal:
function VideoMode : integer; begin if (lastmode = BW40) or (lastmode = BW80) VideoMode := 40 else VideoMode := 80; end;
I've been told "conio.h" has a lastmode function, but it doesn't seem to be supported in Dev-C++ and Visual Studio C++. Is there a Windows function to know the number of columns in the current video mode?