The Philippine Electronics and Technology Forum
February 10, 2012, 12:58:28 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  

Pages: [1]   Go Down
  Print  
Author Topic: help c++ program  (Read 218 times)
ganja
LR44 Battery
*

Pogi/Ganda Points: 0
Offline Offline

Posts: 6


« on: February 17, 2010, 03:44:19 PM »

write a program that will display the ff:

Status code (C/c,T/t,P/p)):
enter the employee name:
enter the no.of hours:
enter the overtime hours:

Employee Neme:
Gross Salary:
Net Pay:
Status:

*status      Status      Rate per Hour
C or c      casual      100.00
T or t       Temporary   200.00
P or p      Permanent     300.00

gross pay= Hours worked * Rate per Hour
Overtime pay= Overtime hour * 100
net pay= Gross Pay + Overtime Pay
Logged
The Philippine Electronics and Technology Forum
« on: February 17, 2010, 03:44:19 PM »

 Logged
mini_mouse ^_^
Size C Battery
*****

Pogi/Ganda Points: 4
Offline Offline

Gender: Female
Posts: 186


...All is Well...


« Reply #1 on: March 08, 2010, 10:34:00 AM »

#include<stdio.h>
*include<conio.h>

char code;
char name[30];

int hour, overtime;
int grosspay, overtimepay,netpay;

main(){
printf("Enter Employee's Code: ");
scanf("%s", &code);

printf("\nEnter Employee's name: ");
getsline(name);

printf("\nEnter Number of Hours: ");
scanf("%d", &hour);

printf("\nEnter number of Overtime: ")
scanf("%d", &overtime);


switch (code){
case c: cas C:
{
grosspay=hour*100;
overtimepay=overtime*100;
netpay=grosspay+overtimepay;

printf("Employee's name: %s", name);
printf("Gross salary: %d", grosspay);
printf("Net Pay: %d", netpay);
printf("Status: Casual");
}


case t: case T:
{
grosspay=hour*200;
overtimepay=overtime*200;
netpay=grosspay+overtimepay;

printf("Employee's name: %s", name);
printf("Gross salary: %d", grosspay);
printf("Net Pay: %d", netpay);
printf("Status: Temporary");
}

case p: cas P:
{
grosspay=hour*300;
overtimepay=overtime*300;
netpay=grosspay+overtimepay;

printf("Employee's name: %s", name);
printf("Gross salary: %d", grosspay);
printf("Net Pay: %d", netpay);
printf("Status: Permanent");
}




}


}

}


}


pseudo code lng po yan and I expect errors pa... wala kasi devC didto sa library na internet section...
edit mo lng if may errors ha,
Logged

...I'm thankful each and every day, coz I found you...
The Philippine Electronics and Technology Forum
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Sample program running program plus circuit please !! « 1 2 »
Microcontroller/Microprocessor Unit Projects and Programming
Siramiko 31 5005 Last post August 27, 2008, 10:39:14 PM
by paranz
elp lan sa program
Love Threads
mark_22creus 0 422 Last post July 27, 2009, 10:39:23 PM
by mark_22creus
c++ program
Computer Software
fran2no 8 1104 Last post October 21, 2009, 03:03:27 PM
by Kaizer03
what program to use in program an sms module??
Microcontroller/Microprocessor Unit Projects and Programming
Nokia 3 925 Last post November 28, 2009, 11:25:16 PM
by kelvinblank
help c++ program
All about ElectronicsLab.PH
ganja 2 487 Last post February 17, 2010, 05:23:09 PM
by Kaizer03
help c++ program
General Electronics and Technology Discussion
ganja 0 234 Last post February 17, 2010, 03:38:35 PM
by ganja
help c++ program
Computer Software
ganja 0 221 Last post February 17, 2010, 03:39:41 PM
by ganja
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!