Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--============================================================================================================//
- //--====||||||||||||====||||||||||====|===========||||||||||=====|============|======|||||||||||=====|==========//
- //--====|===============|========|====|===========|========|=====|=\==========|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|===\========|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|====\=======|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|=====\======|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|=====\======|======|||||||||||=====|==========//
- //--====|===============|========|====|===========|========|=====|======\=====|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|=======\====|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|=======\====|======|===============|==========//
- //--====|===============|========|====|===========|========|=====|========\===|======|===============|==========//
- //--====||||||||||||====||||||||||====|||||||||===||||||||||=====|==========\=|======|||||||||||=====||||||||===//
- //--============================================================================================================//
- //--============================================================================================================//
- /*
- Code by : Promsurin Phutthammawong
- ID: 5910613313
- Task : Wage.c
- Date Submit : 7/11/2016
- */
- //////////////--- Call header files --- /////////////
- #include <stdio.h> // Include standard input output function header
- #include <math.h> // Include math function header
- /////////////// Declare Functions //////////////////
- int getHour(void);
- float getRate(void);
- float calculateWage(int hr,float r);
- // type // name // | Variable in function |
- // Main Code //
- int main()
- {
- int hour = 0; //Declare new variables
- float rate = 0; //Declare new variables
- float wage = 0; //Declare new variables
- hour = getHour(); //Get Value from function getHour
- rate = getRate(); //Get Value from function getRate
- wage = calculateWage(hour,rate); //Get Value from function calculateWage
- printf("Wage is = %.2f BAHT",wage); // Print wage
- return 0;
- }
- /////// Function getHour ////////
- int getHour(void)
- {
- int hours = 0; //Declare new temporary variables
- printf("Enter Worked Hour : "); // Print input
- scanf("%d",&hours); // Scanf input to hours
- return hours; //return variables of this function
- }
- //// End ...
- /////// Function getRate ////////
- float getRate(void)
- {
- float rates = 0; //Declare new temporary variables
- printf("Enter Rate Per Hour : "); // Print input
- scanf("%f",&rates); // Scanf input to rates
- return rates; //return variables of this function
- }
- //// End ...
- /////// Function calculateWage ////////
- float calculateWage(int hr,float r)
- {
- float wages = (float)hr*r; //Declare new temporary variables
- return wages; //return variables of this function
- }
- //// End ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement