I am new to coding and made myself my first little program, which lets me calculate the amount of money I make per hour doing a transcription project. While my code works (yay!) and I am proud of my first attempt at creating a program from scratch, I'm not sure I went about it the most efficient way. Could someone please look this over and let me know where I could improve?
#include <stdio.h>
#include <cs50.h>
int main(void)
{
float clip_time;
float real_time;
float pay_rate;
float pay_amt;
float hours;
do{
printf("Transcription Rates\n");
printf("Clip Time: ");
clip_time = get_float();
}
while(clip_time <= 0);
printf("%.2f min clip pays: ", clip_time);
pay_rate = get_float();
printf("So, $%.2f for the project \n", pay_rate * clip_time);
pay_amt = pay_rate*clip_time;
{
do{
printf("Time to Complete Clip (in minutes): ");
real_time = get_float();
printf("Equals %.2f hours \n", real_time/60);
hours = real_time/60;
}
while(real_time <= 0);
{
printf("Real time spent per audio minute: %.2f \n", real_time / clip_time);
}
{
printf("Hourly pay $%.2f div by %.2f hours equals $%.2f ph \n", pay_amt, hours, pay_amt / hours);
}
}
}