Question

in C programming language Build a shop Commission program that prompts a user for data and...

in C programming language

Build a shop Commission program that prompts a user for data and determine the commission for a merchant selling gear using the following formula:

Commission = Rate * (Sales Price - Cost)

0 1
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

int main()
{
// Creating the variables required for the program.
float rate, commission, sale, cost;
  
// Asking for the cost of the item from the user
printf("Please enter the cost of the item (Only numbers are allowed) : ");
scanf("%f", &cost);
  
// Asking for the selling price of the item from the user
printf("Please enter the Selling Price of the item (Only numbers are allowed): ");
scanf("%f", &sale);
  
// Asking for the rate of commision of the item from the user
printf("Please enter the rate(in \%) of commission (Only numbers are allowed): ");
scanf("%f", &rate);
  
// Calculating the commission amount based on the above values.
commission = rate * (sale-cost) * 0.01;
  
// Printing the value of commission to the stdout.
printf("The Commision for this sale is : %f", commission);
  
return 0;
}

Add a comment
Know the answer?
Add Answer to:
in C programming language Build a shop Commission program that prompts a user for data and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This needs to be written in C. 4. Create a Shop Revenue program that, using the...

    This needs to be written in C. 4. Create a Shop Revenue program that, using the following formula, prompts a user for numbers to determine total revenue for a merchant selling gear: Total Revenue -Price Quantity

  • Language c++ write a recursive function program that prompts the user to enter the number of lines in...

    Language c++ write a recursive function program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern. For example, specifying 4 as the number of lines generates the below pattern * *** ***** ******* ***** *** *

  • Please help C++ language Instructions Write a program that prompts the user to enter 50 integers...

    Please help C++ language Instructions Write a program that prompts the user to enter 50 integers and stores them in an array. The program then determines and outputs which numbers in the array are sum of two other array elements. If an array element is the sum of two other array elements, then for this array element, the program should output all such pairs.

  • IN C language Write a C program that prompts the user to enter a line of...

    IN C language Write a C program that prompts the user to enter a line of text on the keyboard then echoes the entire line. The program should continue echoing each line until the user responds to the prompt by not entering any text and hitting the return key. Your program should have two functions, writeStr andcreadLn, in addition to the main function. The text string itself should be stored in a char array in main. Both functions should operate...

  • C Programming Quesition (Structs in C): Write a C program that prompts the user for a...

    C Programming Quesition (Structs in C): Write a C program that prompts the user for a date (mm/dd/yyyy). The program should then take that date and use the formula on page 190 (see problem 2 in the textbook) to convert the date entered into a very large number representing a particular date. Here is the formula from Problem 2 in the textbook: A formula can be used to calculate the number of days between two dates. This is affected by...

  • write a c program for the above Write a program which prompts the user to enter...

    write a c program for the above Write a program which prompts the user to enter three integers (data type int) and then calculates the arithmetic average as a decimal number and prints the value with two decimal digits. If you have time also calculate and print the harmonic mean of the same numbers according to the following formula: 3. PT harmonic _mean-1 1 22x (Test with integer values of 4, 7, and 8. You may submit one program per...

  • C# programming Create an application that prompts the user for a storm windspeed in mph, then...

    C# programming Create an application that prompts the user for a storm windspeed in mph, then determines the correct typhoon category. The program must run all test cases of storm windspeed in one execution. Use a sentinel value to terminate the program. Do not assume a specific number of inputs. Determine the maximum storm windspeed value input. Note that the maximum must be evaluated within your program. You MAY NOT use C built in function. Output screenshot must include the...

  • Using C++ language P2-4 Write a program that randomly generates an integer and then prompts the...

    Using C++ language P2-4 Write a program that randomly generates an integer and then prompts the user to guess the number. If the user guesses the number correctly, the program outputs an appropriate message such as "You win!" and terminates. Otherwise, the program checks and tell the user whether the guessed number is less or greater than the target number and then prompts him for another try. However, the program gives the user five tries only to guess the correct...

  • Write a program that prompts the user for a positive integer, n, and then prints a...

    Write a program that prompts the user for a positive integer, n, and then prints a following shape of stars using nested for loop, System.out.print(“*”);, and System.out.println();. Example1: Enter a positive integer: 3 * * * * * * * * * Example2: Enter a positive integer: 5 * * * * * * * * * * * * * * * * * * * * * * * * * JAVA LANGUAGE!!

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT