First commit
This commit is contained in:
BIN
IUT/Info1/TD/Exercices/volumeSphere/main
Normal file
BIN
IUT/Info1/TD/Exercices/volumeSphere/main
Normal file
Binary file not shown.
17
IUT/Info1/TD/Exercices/volumeSphere/main.cpp
Normal file
17
IUT/Info1/TD/Exercices/volumeSphere/main.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <iostream>
|
||||
#include "volumeSphere.h"
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
float rayon;
|
||||
float volume;
|
||||
|
||||
cout << "Entrez le rayon de votre sphère : " << endl;
|
||||
cin >> rayon;
|
||||
|
||||
volume = volumeSphere(rayon);
|
||||
|
||||
cout << "le volume de votre sphère est " << volume << " u.a.²" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
IUT/Info1/TD/Exercices/volumeSphere/volumeSphere.cpp
Normal file
10
IUT/Info1/TD/Exercices/volumeSphere/volumeSphere.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "volumeSphere.h"
|
||||
|
||||
float volumeSphere(float rayon) {
|
||||
const float PI = 3.141592;
|
||||
float volume;
|
||||
|
||||
volume = rayon * rayon * rayon * PI * 4.0 / 3.0;
|
||||
|
||||
return volume;
|
||||
}
|
||||
1
IUT/Info1/TD/Exercices/volumeSphere/volumeSphere.h
Normal file
1
IUT/Info1/TD/Exercices/volumeSphere/volumeSphere.h
Normal file
@@ -0,0 +1 @@
|
||||
float volumeSphere(float);
|
||||
Reference in New Issue
Block a user