Thread: Program help

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052

    Program help

    Hey, everything in my program works except for this portion of code:
    Code:
    totalpayed = ( (mon + tue + wed + thu + fri + sat) * payrate );
    sunpayed = sun * sunpayrate;
    totalpayed += sunpayed;
    I dont know why but the calculation always ends up wrong. Here's the rest of the code...

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Is payrate an int, double, or float?

  3. #3
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    they are all double's

  4. #4
    Registered User quagsire's Avatar
    Join Date
    Jun 2002
    Posts
    60
    Hi,
    You were using the same editbox for all the days.

    I also prefer using sprintf above _gcvt as it is ANSI and _gcvt not

    Code:
    	GetDlgItemText(hDlg, IDC_MON, monstr, 10);
    	GetDlgItemText(hDlg, IDC_MON, tuestr, 10);
    	GetDlgItemText(hDlg, IDC_MON, wedstr, 10);
    	GetDlgItemText(hDlg, IDC_MON, thustr, 10);
    	GetDlgItemText(hDlg, IDC_MON, fristr, 10);
    	GetDlgItemText(hDlg, IDC_MON, satstr, 10);
    	GetDlgItemText(hDlg, IDC_MON, sunstr, 10);
    should change to
    Code:
    	GetDlgItemText(hDlg, IDC_MON, monstr, 10);
    	GetDlgItemText(hDlg, IDC_TUE, tuestr, 10);
    	GetDlgItemText(hDlg, IDC_WED, wedstr, 10);
    	GetDlgItemText(hDlg, IDC_THU, thustr, 10);
    	GetDlgItemText(hDlg, IDC_FRI, fristr, 10);
    	GetDlgItemText(hDlg, IDC_SAT, satstr, 10);
    	GetDlgItemText(hDlg, IDC_SUN, sunstr, 10);

  5. #5
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    ah crap. Im so dumb. Ahh!!! I forgot to change them after I pasted them all.

    Ok we have now extablished I am very dumb!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM