//*******************************************************
//
// Homework: 1 (Chapter 4/5)
//
// Name: Blake Shetler
//
// Class: C Programming, Fall 2024
//
// Date: 09/14/2024
//
// Description: Program which determines gross pay and outputs
// to the screen. This version does not use file pointers
//
// Non file pointer solution
//
//********************************************************
#include <stdio.h>
int main( )
{
//declare variables
int clock_number;
float wage_rate;
float hours_worked;
float gross_pay;
//prompt employee to enter clock ID, hourly rate, and hours worked
printf ( "\t ~~~~~~~~ Pay Calulator ~~~~~~~~\n " ) ;
printf ( "Enter employee's clock number: \n " ) ;
scanf ( "%d" , & clock_number) ;
printf ( "Enter hourly wage for employee: \n " ) ;
scanf ( "%f" , & wage_rate) ;
printf ( "Enter the number of hours the employee worked this week: \n " ) ;
scanf ( "%f" , & hours_worked) ;
//calucation for gross pay
gross_pay = wage_rate * hours_worked;
//printing out results
printf ( "\t =========================\n " ) ;
printf ( "\t Clock# Wage Hours Gross\n " ) ;
printf ( "\t =========================\n " ) ;
printf ( "\t %06i %.2f % 2.1f % 6.2f" , clock_number, wage_rate, hours_worked, gross_pay) ;
return ( 0 ) ;
}
Ly8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAovLyAKLy8gSG9tZXdvcms6IDEgKENoYXB0ZXIgNC81KSAKLy8gCi8vIE5hbWU6IEJsYWtlIFNoZXRsZXIKLy8gCi8vIENsYXNzOiBDIFByb2dyYW1taW5nLCBGYWxsIDIwMjQKLy8gCi8vIERhdGU6IDA5LzE0LzIwMjQKLy8gCi8vIERlc2NyaXB0aW9uOiBQcm9ncmFtIHdoaWNoIGRldGVybWluZXMgZ3Jvc3MgcGF5IGFuZCBvdXRwdXRzIAovLyB0byB0aGUgc2NyZWVuLiAgIFRoaXMgdmVyc2lvbiBkb2VzIG5vdCB1c2UgZmlsZSBwb2ludGVycwovLwovLyBOb24gZmlsZSBwb2ludGVyIHNvbHV0aW9uIAovLyAKLy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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