Pascal Programming beginners question

Discussion in 'Software' started by KERWINN13, Nov 11, 2011.

  1. KERWINN13

    KERWINN13 Private E-2

    Hi i am new to pascal but i am having this problem this is the question Develop a pseudocode algorithm to calculate the wages for each employee in the company. I was using the if-then-else loop to calculate the basic salary but it comes up as zero:confused. I had if jobtitle=('manager') then salary:=100*numberofhoursworked)
    and at the end of the if-then-else i had writeln(salary);
    GIANT THANKS EVERYONE:)
    Each employee works up to 160 hours per month and gets paid at their normal rate. The hours above 160 is called overtime and is paid at twice the normal rate. The normal rates of pay are displayed in the table below:
    JOB TITLE NORMAL RATE (per Hour)
    Manager $100
    Accountant $80
    Sales Representative $50
    Courier Driver $30
    The algorithm must accept as input the employee number, job title and the number of hours worked for the month. The rates of pay can be embedded in the program or read from a permanent data store such as a text file.
     
  2. Wyatt_Earp

    Wyatt_Earp MajorGeek

    I'm confused. Are you writing a program in Pascal or just creating pseudo-code?
     
  3. KERWINN13

    KERWINN13 Private E-2

    yeah man i am trying to write a program in pascal not the algorithm. I got this question as a project from my I.t teacher
     
  4. PC-XT

    PC-XT Master Sergeant

    I would write the salary, numberofhoursworked and jobtitle before the if-then-else as a starting point to compare the end results with, at least during development. It might be that numberofhoursworked starts out as 0 or jobtitle is capitalized or has an extra space or something.
     
  5. Wyatt_Earp

    Wyatt_Earp MajorGeek

    If you could post the code you've got, we could probably give better advice.

    What do you mean by 'if-then-else loop'. Do you have an if block inside of a for loop? How are you getting the input? Also, I think PC-XT alluded to it, but when you compare jobtitle to 'manager', it is most likely case sensitive. (i.e. 'manager' does not equal 'Manager')
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds