ajout du tp 3 de Cpp

master
antoine.perederii 2 years ago
parent a28a6b96b7
commit 6d7420d343

@ -0,0 +1,5 @@
{
"files.associations": {
"iosfwd": "cpp"
}
}

@ -17,6 +17,8 @@ public :
Passager(std::string nom, std::string prenom);
Wagon getWagonActuel() const;
friend std::ostream &operator<<(std::ostream &s, const Passager &p);
~Passager();
};

@ -24,7 +24,7 @@ void testTrain(void) {
int main() {
testPassager();
testWagon();
testTrain();
// testWagon();
// testTrain();
return 0;
}

@ -22,6 +22,8 @@ int Wagon::enlever(Passager lePassager) {
return 0;
}
// ostream &operator<<(ostream &s, const Passager &p) {
// }
ostream &operator<<(ostream &s, const Passager &p) {
s << "Wagon n° " << w.numero << " : " << w.nbPassagers->size() << " passager(s)." << endl;
s << "Reste " << w.capacite - w.nbPassagers->size() << " places(s)." << endl;
s << "Liste des passagers :\n" << w.
}

@ -21,10 +21,11 @@ public :
int ajouter(Passager lePassager);
int enlever(Passager lePassager);
friend std::ostream &operator<<(std::ostream &s, const Passager &w);
~Wagon() = default; //~Wagon(){};
};
std::ostream &operator<<(std::ostream &s, const Passager &p);
#endif // WAGON_HPP

@ -5,6 +5,5 @@
\i pratiquer.sql
\i epreuve.sql
\i resultats.sql
\i requetes.sql
\d

@ -0,0 +1,40 @@
-- Question 1
SELECT d.*
FROM Discipline d, Epreuve e
WHERE d.code=e.discipl AND e.dateE < '2021-08-01' AND e.dateE > '2021-06-30'
GROUP BY d.code
HAVING count(*) >=ALL (SELECT count(*)
FROM Epreuve
WHERE dateE >= '2021-08-01' AND dateE <= '2021-08-31' AND d.code=discipl);
-- code | nom
-- ------+-----------------------
-- FEN | Fencing
-- JUD | Judo
-- TKW | Taekwondo
-- GTR | Trampoline Gymnastics
-- TRI | Triathlon
-- TTE | Table Tennis
-- CRD | Cycling Road
-- SKB | Skateboarding
-- SWM | Swimming
-- BK3 | 3x3 Basketball
-- SRF | Surfing
-- ROW | Rowing
-- RUG | Rugby Sevens
-- BSB | Baseball/Softball
-- DIV | Diving
-- SHO | Shooting
-- BMX | Cycling BMX Racing
-- CSL | Canoe Slalom
-- ARC | Archery
-- TEN | Tennis
-- WLF | Weightlifting
-- Question 2
SELECT p.nom
FROM pays p, Athlete a, Resultat r
WHERE
-- Question 3
SELECT
Loading…
Cancel
Save