Question

Use c program to: The clinic wish to give 15% discount on the fees to be...

Use c program to:

The clinic wish to give 15% discount on the fees to be paid by the patients whose age is above 60. Develop an algorithm, flow chart and write a C program to read age of the patient and calculate the fees after the discount by writing a function with argument. Display the result with appropriate statements.

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

#include <stdio.h>
float getDiscount(float a){
return a*0.15;
}
int main()
{
int age;
float amount,discount=0;
printf("Enter age: ");
scanf("%d",&age);
printf("Enter patient bill: ");
scanf("%f",&amount);
if(age>=60)
   discount=getDiscount(amount);
printf("Total bill after discount: %.1f",amount-discount);

return 0;
}

Algorithm:

DECLARE AGE,AMOUNT,DISCOUNT=0
READ AGE
READ AMOUNT
IF AGE>=60
   DISCOUNT=AMOUNT *0.15
AMOUNT=AMOUNT-DISCOUNT
PRINT AMOUNT

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
Use c program to: The clinic wish to give 15% discount on the fees to be...
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
  • A Private Poly Clinic in Oman wish to develop software to automate their Patient Monitoring system...

    A Private Poly Clinic in Oman wish to develop software to automate their Patient Monitoring system for storing the details of the patients visited the clinic. Develop a system to meet the following requirements: The clinic wish to give 15% discount on the fees to be paid by the patients whose age is above 60. Develop an algorithm, flow chart and write a C program to read age of the patient and calculate the fees after the discount by writing...

  • A Private Poly Clinic in City wish to develop software to automate their Patient Monitoring system...

    A Private Poly Clinic in City wish to develop software to automate their Patient Monitoring system for storing the details of the patients visited the clinic. Develop a system to meet the following requirements: Patient Id Fees in (OMR)       Gender P001 15 M P002 10 F P003 20 M P004 8 F P005 12 M The clinic wish to give 15% discount on the fees to be paid by the patients whose age is above 60. Develop an algorithm,...

  • Use C programe to : Develop an algorithm, flow chart and write a C program to...

    Use C programe to : Develop an algorithm, flow chart and write a C program to read the name of a patient which has a multi word and display it and the acromatic string of the name. Sample Output : Name : Khamis Al Araimi                            Acromatic String: AKAA.

  • 1) (80pts) Consider the following function f(x)--x5-4x4 + 2x3 + x2-3x + 5 Develop a simple program which will give an iterative solution to the problem f(x)=0 by Newton's algorithm. The solut...

    1) (80pts) Consider the following function f(x)--x5-4x4 + 2x3 + x2-3x + 5 Develop a simple program which will give an iterative solution to the problem f(x)=0 by Newton's algorithm. The solution should display the results on an Excel spreadsheet such as the one given below (the example below is given for a different function). Choose the programming language which suits you most, however the program should be able to read data from an Excel spreadsheet and write the successive...

  • Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve...

    Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve the following program. -Use Microsoft Visual C++ .NET 2010 Professional compiler using default compiler settings. -Use Microsoft Visio 2013 for developing your flowchart. -Adherence to the ANSI C++  required -Do not use <stdio.h> and <conio.h>. -Do not use any #define in your program. -No goto statements allowed. Upon execution of the program, the program displays a menu as shown below and the user is prompted to make a selection from the menu....

  • Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its...

    Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its loyal customers. The rewards program offers three levels, Gold(G), Silver(S), and Bronze(B). Discounts on the customer’s sales receipt are provided in the table below along with additional discounts for only the amount of the purchase over $200.00. A maximum discount amount for any purchase is $30.00. Your program should prompt the user for their current reward level and sales receipt amount. Based on the...

  • For this c++ assignment, Overview write a program that will process two sets of numeric information....

    For this c++ assignment, Overview write a program that will process two sets of numeric information. The information will be needed for later processing, so it will be stored in two arrays that will be displayed, sorted, and displayed (again). One set of numeric information will be read from a file while the other will be randomly generated. The arrays that will be used in the assignment should be declared to hold a maximum of 50 double or float elements....

  • Must be written in C++ Bank Charges A bank charges $15 per month plus the following...

    Must be written in C++ Bank Charges A bank charges $15 per month plus the following check fees for a commercial checking account: $0.10 per check each for fewer than 20 checks (1-19) $0.08 each for 20–39 checks $0.06 each for 40–59 checks $0.04 each for 60 or more checks Write a program that asks for the number of checks written during the past month, then computes and displays the bank’s fees for the month. Input Validation: Display an error...

  • Develop a functional flowchart and then write a C++ program to solve the following problem. 1....

    Develop a functional flowchart and then write a C++ program to solve the following problem. 1. Create a text file named c1.txt and write your brand of computer (like Dell, HP, etc) in the file. You will be reading the name of the file from the keyboard as a string, using the string class. Your program will also read the brand of your computer from the keyboard. The process of the file creation (name of the file, mode for opening...

  • IN C++ ADD COMMENTS AS MUCH AS POSSIBLE Exercise 1: Duplicate the Arrays Suppose you are...

    IN C++ ADD COMMENTS AS MUCH AS POSSIBLE Exercise 1: Duplicate the Arrays Suppose you are developing a program that works with arrays of integers, and you find that you frequently need to duplicate the arrays. Rather than rewriting the array-duplicating code each time you need it, you decide to write a function that accepts an array and its size as arguments. Creates a new array that is a copy of the argument array, and returns a pointer to the...

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