Your establishment's photocopy Center charges 0.25 DH for the first 10 photocopies, 0.20 DH for the next 20 and 0.10 DH beyond 20 photocopies. Write a program that prompts the user for the number of photocopies made and displays the corresponding invoice.


******** In Algorithm ********

Algorithm Variables Nb_papies: integers price : real begin write("Enter the number of papies :") read(Nb_papies) if ( Nb_papies <= 10 ) then price ← Nb_papies * 0.25 next_if

if(Nb_papies >10 and Nb_papies<=20) price ← Nb_papies *0.20 FinSi

if (Nb_papies > 20) price ← Nb_papies * 0.10 next_if write(" the price total :",price,"Dh") End Result ==> enter the number of papies : 17 the price total : 3.4 DH

******** In language C ********

#include <stdio.h> int main() { int Nb_papies; float price; printf(" Enter the number of papies :"); scanf("%d",&Nb_papies);

if ( Nb_papies <= 10 ) price = Nb_papies *0.25;

if ( Nb_papies > 10 && Nb_papies<= 20 ) price = Nb_papies *0.20;

if ( Nb_papies > 20 ) price = Nb_papies *0.10; printf("the price total : %.2fDh", price); return 0; }


******** In C++ ********

#include <iostream> using namespace std; int main() { int Nb_papies; float price ; cout<<" Enter the number of papies :"; cin>>Nb_papies; if ( Nb_papies <= 10 ) price = Nb_papies *0.25;
if ( Nb_papies > 10 && Nb_papies<= 20 ) price = Nb_papies *0.20;
if ( Nb_papies > 20 ) price = Nb_papies *0.10; cout<<"the price total :"<<price<<" DH"; return 0; }