First commit
This commit is contained in:
BIN
IUT/Info1/TD/Exercices/TVA/main
Normal file
BIN
IUT/Info1/TD/Exercices/TVA/main
Normal file
Binary file not shown.
25
IUT/Info1/TD/Exercices/TVA/main.cpp
Normal file
25
IUT/Info1/TD/Exercices/TVA/main.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <iostream>
|
||||
#include "tva.h"
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
float prixUnitaireHT;
|
||||
float nombreArticles;
|
||||
float tauxTVAPourcent;
|
||||
float prixTotalTTC;
|
||||
|
||||
cout << "Saisir le prix unitaire HT" << endl;
|
||||
cin >> prixUnitaireHT;
|
||||
cout << "Saisir le nombre d'articles" << endl;
|
||||
cin >> nombreArticles;
|
||||
cout << "Saisir le taux de TVA en pourcentage" << endl;
|
||||
cin >> tauxTVAPourcent;
|
||||
|
||||
prixTotalTTC = tva(
|
||||
prixUnitaireHT, nombreArticles, tauxTVAPourcent
|
||||
);
|
||||
|
||||
cout << "Prix TTC de la commande : " << prixTotalTTC << "€" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
16
IUT/Info1/TD/Exercices/TVA/tva.cpp
Normal file
16
IUT/Info1/TD/Exercices/TVA/tva.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "tva.h"
|
||||
|
||||
float tva(
|
||||
float prixHTUnit,
|
||||
int nbArticles,
|
||||
float tauxTVAPourcent
|
||||
) {
|
||||
|
||||
float montantTVA;
|
||||
float prixTotalTTC;
|
||||
|
||||
montantTVA = prixHTUnit * tauxTVAPourcent / 100;
|
||||
prixTotalTTC = nbArticles * (prixHTUnit + montantTVA);
|
||||
|
||||
return prixTotalTTC;
|
||||
}
|
||||
1
IUT/Info1/TD/Exercices/TVA/tva.h
Normal file
1
IUT/Info1/TD/Exercices/TVA/tva.h
Normal file
@@ -0,0 +1 @@
|
||||
float tva(float, int, float);
|
||||
Reference in New Issue
Block a user