PROBLEM #1 IF AND ELSE PROBLEM! DONT KNOW THE CODES @@

0 jerdark fernandez · August 6, 2015
Each sales person earns a regular weekly pay of 1000 pesos moreover if the salesperson
total weekly sales exceed 5000 pesos a commission of a 9.8% is earned on sales, otherwise
the commission is flat 250 pesos. construct a c program to compute the weekly commission 
and print the regular pay, weekly sales, weekly commission and the weekly gross pay.

HELP ME PLSS!

Post a Reply

Replies

Oldest  Newest  Rating
0 Ahmed Samir · August 6, 2015
That should do 


#include

void main(){


float commission, regular, grosspay, Sales;


regular = 1000;

printf("Enter the perosn's sales \n");
scanf_s(" %f", &Sales);

if (Sales > 5000){

commission = 9.8*Sales / 100;


}
else{
commission = 250;
}

grosspay = commission + regular;

printf("Regular pay = %.2f \t Weekly sales = %.2f \n", regular, Sales);
printf("Weekly commission = %.2f \t Weekly gross pay= %.2f", commission, grosspay);



}
  • 1

C

107,005 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator