Question

   Draw the hierarchy chart and then plan the logic for a program for the sales manager of The RHC Company Ltd. The manager needs a program to determine the profit on any item sold. Input includes th...

  

  • Draw the hierarchy chart and then plan the logic for a program for the sales manager of The RHC Company Ltd. The manager needs a program to determine the profit on any item sold. Input includes the wholesale price and retail price for an item. The output is the item's profit, which is the retail price minus the wholesale price. Use three modules. The main program declares global variables and calls housekeeping, detail, and end-of-job modules. The housekeeping module prompts for and accepts a wholesale price. The detail module prompts for and accepts the retail price, computes the profit, and displays the result. The end-of-job module displays the message “Thanks for using this program”.
  • Can you reference your source of information after answering.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear student, according to the question, the solution is as follows:

Program:

#include <stdio.h>
int wholesale_price, retail_price,profit; // Global Variables
void houseKepping()
   {
       printf("Enter the wholesale_price of an item : ");
       scanf("%d",&wholesale_price);
   }
   void detail()
   {
       printf("Enter the retail_price of an item : ");
       scanf("%d",&retail_price);
     
       profit =retail_price - wholesale_price; //profit calculation
       printf("\nThe Profit is : %d\n",profit); //displaying the profit
   }
   void End_of_the_job()
   {
       printf("Thanks for using this program");
   }
int main()
{

// Calling all the three modules
    houseKepping();
    detail();
    End_of_the_job();
    return 0;
}

Output:

Online C Compiler - online editor - Mozilla Firefox (Private Browsing) Online C Compiler C Expert Q&A | Cheg filereadinginc -

Case 2:

,团4) 3:19PM * Online C Compiler - online editor - Mozilla Firefox (Private Browsing) Online C Compiler 6 filereadinginc-Go ©

Thank you, All the best.

If at all any doubts feel free to contact through the comment section.

Add a comment
Know the answer?
Add Answer to:
   Draw the hierarchy chart and then plan the logic for a program for the sales manager of The RHC Company Ltd. The manager needs a program to determine the profit on any item sold. Input includes th...
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
  • Draw the hierarchy chart and design the logic for a program that calculates the projected cost...

    Draw the hierarchy chart and design the logic for a program that calculates the projected cost of a remodeling project. Assume that the labor cost is $30 per hour. Design a program that prompts the user for a number hours projected for the job and the wholesale cost of materials. The program computes and displays the cost of the job which is the number of hours times the hourly rate plus the 120% of the wholesale cost of materials. The...

  • Question 3.1 Draw the class diagram for the ATM program in Question 2.1. Please find attached...

    Question 3.1 Draw the class diagram for the ATM program in Question 2.1. Please find attached the scenario in the photos. this is for programming logic and design Scenario A local bank intends to install a new automated teller machine (ATM) to allow users (i.e., bank customers) to perform basic financial transactions (see below figure). Each user can have only one account at the bank. ATM users should be able to do the following; View their account balance. Withdraw cash...

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