I just stated programming a week ago and am having some problems with this program i am making. I wrote it and then compiled it and executed it and that all worked, but then when i tried to run it it wasnt what i wanted. I want it to ask some questions then calculate some answeres. Here is my program can you tell me how to fix it?
Thanks
Code:
#include <stdio.h>
int main()
{
float hundredthirteen = 113.0;
float decimal = 0.096;
float five= 5.0;
float scoreone, rating, slope;
float scoretwo, ratingtwo, slopetwo;
float scorethree, ratingthree, slopethree;
float scorefour, ratingfour, slopefour;
float scorefive, ratingfive, slopefive;
float partone, parttwo, partthree, handicapone;
float partonetwo, parttwotwo, partthreetwo, handicaptwo;
float partonethree, parttwothree, partthreethree, handicapthree;
float partonefour, parttwofour, partthreefour, handicapfour;
float partonefive, parttwofive, partthreefive, handicapfive;
float partfour, handicapindex;
printf("You will enter your last five golf scores and this will find your handicap index");
printf("Score 1: What did you shoot? ");
scanf("%*scoreone%.0f");
printf("What is the course rating? ");
scanf("%*rating%.0f");
printf("What is the course slope? ");
scanf("%*slope%.0f");
partone = scoreone - rating;
parttwo = partone * hundredthirteen;
partthree = parttwo / slope;
handicapone = partthree * decimal;
printf("\nScore 2: What did you shoot? ");
scanf(" %.0f", &scoretwo);
printf("\nWhat is the course rating? ");
scanf(" %.1f", &ratingtwo);
printf("\nWhat is the course slope? ");
scanf(" %.0f", &slopetwo);
partonetwo = scoretwo - ratingtwo;
parttwotwo = partonetwo * hundredthirteen;
partthreetwo = parttwotwo / slopetwo;
handicaptwo = partthreetwo * decimal;
printf("\nScore 3: What did you shoot? ");
scanf(" %.0f", &scorethree);
printf("\nWhat is the course rating? ");
scanf(" %.1f", &ratingthree);
printf("\nWhat is the course slope? ");
scanf(" %.0f", &slopethree);
partonethree = scorethree - ratingthree;
parttwothree = partonethree * hundredthirteen;
partthreethree = parttwothree / slopethree;
handicapthree = partthreethree * decimal;
printf("\nScore 4: What did you shoot? ");
scanf(" %.0f", &scorefour);
printf("\nWhat is the course rating? ");
scanf(" %.1f", &ratingfour);
printf("\nWhat is the course slope? ");
scanf(" %.0f", &slopefour);
partonefour = scorefour - ratingfour;
parttwofour = partonefour * hundredthirteen;
partthreefour = parttwofour / slopefour;
handicapfour = partthreefour * decimal;
printf("\nScore 5: What did you shoot? ");
scanf(" %.0f", &scorefive);
printf("\nWhat is the course rating? ");
scanf(" %.1f", &ratingfive);
printf("\nWhat is the course slope? ");
scanf(" %.0f", &slopefive);
partonefive = scorefive - ratingfive;
parttwofive = partonefive * hundredthirteen;
partthreefive = parttwofive / slope;
handicapfive = partthreefive * decimal;
partfour = handicapone + handicaptwo + handicapthree + handicapfour + handicapfive;
handicapindex = partfour / five;
printf(" Your handicap index is %.2f", handicapindex);
return 0;
}