@EverettErlandso/

# Parts of a Program - Template-1

## Parts of a program is showing how much money a person makes and how many hours they worked.

Files
• main.c
main.c
```1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
```
```/*Andrea Szalankiewicz
File: PartsOfProgram.c
Purpose: To learn about the parts of a program and how they influence the program*/

#include <stdio.h>
int main() {

//Introduction
printf("\nWelcome Paycheck Calculator!\n\n");
printf("Given your hourly wage, hours worked, and the number of days worked, your paycheck will be calculated.\n\n");

/*Declare variables - float, double, and int are types of
numerical variables - Can you figure out which are whole numbers and which are decimals?*/
float money_per_hour;
double hours_worked_day;
float money_per_day;
int num_days;
double total_money_earned;

//CODER assigns value to the variables
money_per_hour = 15.50;
num_days = 4;
//USER assigns value to the variables
printf("How many hours did you work today? ");
scanf("%lf", &hours_worked_day);

//Manipulate variables (aka Calculations)
money_per_day = money_per_hour*hours_worked_day;total_money_earned = money_per_day*num_days;

//Display results
printf("\n\nThe total money earned each day is: \$%lf because you worked %0.1lf hours per day at a rate of \$%f per hour.\n\n", money_per_day, hours_worked_day, money_per_hour);

printf("Your paycheck should be \$%0.2lf since you earned \$%0.2lf each day and worked %d days.\n\n", total_money_earned, money_per_day, num_days);

printf("Enjoy your dinero and spend/save smartly!\n");

return 0;
}```
Fetching token