From 274acb8d47cd47845ee1ce881c5e41e61050c6b4 Mon Sep 17 00:00:00 2001 From: narnaud Date: Mon, 13 Jun 2022 18:04:19 +0200 Subject: [PATCH] C00 --- CPP00/ex00/Makefile | 16 +++++++++ CPP00/ex00/main.cpp | 34 ++++++++++++++++++ CPP00/ex00/megaphone | Bin 0 -> 19212 bytes CPP00/ex01/Contact.cpp | 55 ++++++++++++++++++++++++++++++ CPP00/ex01/Contact.hpp | 39 +++++++++++++++++++++ CPP00/ex01/PhoneBook.cpp | 72 +++++++++++++++++++++++++++++++++++++++ CPP00/ex01/PhoneBook.hpp | 29 ++++++++++++++++ CPP00/ex01/a.out | Bin 0 -> 39968 bytes CPP00/ex01/main.cpp | 22 ++++++++++++ README.md | 10 ++++++ 10 files changed, 277 insertions(+) create mode 100644 CPP00/ex00/Makefile create mode 100644 CPP00/ex00/main.cpp create mode 100755 CPP00/ex00/megaphone create mode 100644 CPP00/ex01/Contact.cpp create mode 100644 CPP00/ex01/Contact.hpp create mode 100644 CPP00/ex01/PhoneBook.cpp create mode 100644 CPP00/ex01/PhoneBook.hpp create mode 100755 CPP00/ex01/a.out create mode 100644 CPP00/ex01/main.cpp diff --git a/CPP00/ex00/Makefile b/CPP00/ex00/Makefile new file mode 100644 index 0000000..c1de22d --- /dev/null +++ b/CPP00/ex00/Makefile @@ -0,0 +1,16 @@ +NAME = megaphone +SRC = main.cpp + +CC = c++ +CFLAGS = -std=c++98 -Wall -Werror -Wextra +RM = rm -rf + +$(NAME): $(SRC) + $(CC) $(CFLAGS) $(SRC) -o $(NAME) + +all: $(NAME) + +clean: + $(RM) $(NAME) + +.PHONY: all re diff --git a/CPP00/ex00/main.cpp b/CPP00/ex00/main.cpp new file mode 100644 index 0000000..54d37c2 --- /dev/null +++ b/CPP00/ex00/main.cpp @@ -0,0 +1,34 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: narnaud +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/06/13 08:20:39 by narnaud #+# #+# */ +/* Updated: 2022/06/13 08:44:34 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ + +# include +# include + +int main(int argc, char **argv) +{ + if (argc < 2) + std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *"; + else + { + int i = 1; + char *ret; + while (i < argc) + { + ret = argv[i]; + while (*ret) + std::cout << (char)toupper(*(ret++)); + i++; + } + } + std::cout << std::endl; + return (EXIT_SUCCESS); +} diff --git a/CPP00/ex00/megaphone b/CPP00/ex00/megaphone new file mode 100755 index 0000000000000000000000000000000000000000..2f79b4db98c8444e708b8d20c33c981692a0daeb GIT binary patch literal 19212 zcmeHPdr(~0c|W@#8%2tCtvC+#OINbxN|qz#c*mu0!Yb`}=z zLytPt>mV{*ZBWQ0X_av@!=(O0Z8{nL@WiTSOpt5~;xtUQq&u$L-pyc}@u(J~ zkxhT!x##ZQy+Eu-)PK5nIQN|2d3@*lzVn^;UEaL%-Y2&+<|<(<NIvic#TGuULbxO%I-5{|sveY|JXn~8mzN6Tn809#k-JSKt7<|! znh*eJQf2QY4cvZlDwm%pWpXJh0!KBdn@@5jB3Sw<8)+`xCKc>6KAtdL*+v593AcdA9}N zt7>=DW_F9{l}RRl@c2WRc(NX%caH_&t7;_p`}o@=ne=8v8NzmY=(Eh;H2Hqo+_zF5TXWYN<-QMoarlL2-uuRTD=H8t!GTrA)_jIL3Y)rI>wXwvFQtiR z6T~DsG;Y`*suwEYb&$-ZD@Q@bmFETggtlzi>fZ{c!X2E?8e4wXm3J`=73Oa}7Efrs zTX%^f$j#V8aKz7(P!yHlEHLS}_!Koz)Id=KMGX`+P}D$C14RwodJVKG`hO~evvpJQ zRjN!Mm{;`V+~B~x+cR=6B9!#bb6Bq_BUQh{iqY7Mb*iGv7qhfin388{shO5%cgXXe zk+1XY@|+TCnN`xI)5w=m(sCwM!#u~atOhMa=;xHdb1p@1$#^DejKBIU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z$9NmxkSZWbOzW3ht5g}%6}0cIs-~i#nu>}=(x_TQ>%D1_n!`T1xx**RyRW^%!Xv=u zupbosizpQ2a!_yfV;D_D)mZR|+8@Q?u@-A=!f_%xA|0OHwCVbB21b2f&=#t^soqeF zgU+}biS~8>A*lIlOa_VGACgNy*d)Q@J<-^5;@={Rt?CNL;*LS~)|;(4$QSe#f2C-4 z>y840s_ggWBBMB=_1ovy=GtIqCyf))F3SoJV7|1CTh}wU!PKv92L99uuPWAwNvP1= z@ +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/06/13 13:29:20 by narnaud #+# #+# */ +/* Updated: 2022/06/13 16:48:13 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Contact.hpp" +Contact::Contact(){} + +void Contact::set(int id) +{ + this->id = id; + std::cout << "Enter new contact first name:\n"; + std::cin >> this->datas[FIRST]; + std::cout << "Enter new contact last name:\n"; + std::cin >> this->datas[LAST]; + std::cout << "Enter new contact nickname:\n"; + std::cin >> this->datas[NICK]; + std::cout << "Enter new contact number:\n"; + std::cin >> this->datas[NUMBER]; + std::cout << "Enter new contact secret:\n"; + std::cin >> this->datas[SECRET]; + std::cout << std::endl; +} + +void Contact::summary() +{ + std::cout << "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"; + std::cout << "|"; + std::cout << std::setw(2) << this->id; + std::cout << "|"; + for (int i = 0; i <= SECRET; i++) + { + if (this->datas[i].length() < 10) + std::cout << std::setw(10) << this->datas[i] << "|"; + else + std::cout << this->datas[i].substr(0, 9) << "." << "|"; + } + std::cout << "\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n"; +} + +void Contact::get() +{ + std::cout <<"First name : " << this->datas[FIRST] << std::endl; + std::cout <<"Last name : " << this->datas[LAST] << std::endl; + std::cout <<"Nick name : " << this->datas[NICK] << std::endl; + std::cout <<"Phone nb : " << this->datas[NUMBER] << std::endl; + std::cout <<"Dark secret : " << this->datas[SECRET] << std::endl; +} diff --git a/CPP00/ex01/Contact.hpp b/CPP00/ex01/Contact.hpp new file mode 100644 index 0000000..5d7665c --- /dev/null +++ b/CPP00/ex01/Contact.hpp @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Contact.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: narnaud +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/06/13 13:02:55 by narnaud #+# #+# */ +/* Updated: 2022/06/13 16:35:43 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ +#ifndef CONTACT_HPP +# define CONTACT_HPP + +# include +# include +# include + +enum e_datas +{ + FIRST, + LAST, + NICK, + NUMBER, + SECRET, +}; + +class Contact +{ + public: + Contact(); + void set(int id); + void summary(); + void get(); + private: + int id; + std::string datas[5]; +}; +#endif diff --git a/CPP00/ex01/PhoneBook.cpp b/CPP00/ex01/PhoneBook.cpp new file mode 100644 index 0000000..f2e798d --- /dev/null +++ b/CPP00/ex01/PhoneBook.cpp @@ -0,0 +1,72 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* PhoneBook.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: narnaud +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/06/13 10:14:16 by narnaud #+# #+# */ +/* Updated: 2022/06/13 16:00:30 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "PhoneBook.hpp" + +PhoneBook::PhoneBook() +{ + this->id = 0; +} + +void PhoneBook::add() +{ + int id = this->id % CONTACTS_AMOUNT; + if (this->id > 7) + { + std::cout << "You gonna remove the contact n." << id; + std::cout << "\nTo continue, type 'y': "; + std::string confirm = 0; + std::cin >> confirm; + if (confirm != "y") + { + std::cout << "\nAbort.\n"; + return ; + } + std::cout << std::endl; + } + this->contacts[id].set(id); + this->id++; +} +void PhoneBook::search() +{ + int id = 0; + Contact ctct; + + ctct = this->contacts[0]; + while (id++ < this->id % CONTACTS_AMOUNT) + { + ctct.summary(); + ctct = this->contacts[id]; + } + std::string sid; + std::cout << "Which contact do you wanna see [id?]:"; + std::cin >> sid; + id = std::stoi(sid); + ctct = this->contacts[id]; + ctct.get(); +} + +int PhoneBook::run() +{ + std::cout << "PhoneBook.\n" << "Commands available : ADD, SEARCH, EXIT.\n"; + std::cout << "What do you want?\n"; + std::cin >> this->cmd; + if (cmd == "EXIT") + return (EXIT_FAILURE); + if (cmd == "SEARCH") + this->search(); + else if (cmd == "ADD") + this->add(); + else + std::cout << "Unknown command.\n"; + return (EXIT_SUCCESS); +} diff --git a/CPP00/ex01/PhoneBook.hpp b/CPP00/ex01/PhoneBook.hpp new file mode 100644 index 0000000..88ce766 --- /dev/null +++ b/CPP00/ex01/PhoneBook.hpp @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* PhoneBook.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: narnaud +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/06/13 09:31:44 by narnaud #+# #+# */ +/* Updated: 2022/06/13 15:35:30 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ +#ifndef PHONEBOOK_HPP +# define PHONEBOOK_HPP +# include "Contact.hpp" +# define CONTACTS_AMOUNT 8 + +class PhoneBook +{ + public: + PhoneBook(); + int run(); + private: + Contact contacts[CONTACTS_AMOUNT]; + std::string cmd; + int id; + void add(); + void search(); +}; +#endif diff --git a/CPP00/ex01/a.out b/CPP00/ex01/a.out new file mode 100755 index 0000000000000000000000000000000000000000..d05e75f254420f06b7c4f5e91abf3c8f2af2f309 GIT binary patch literal 39968 zcmeHw3wT^rwf{MJl(y8)z=dm3p+f;}ZH1Y%Nn4;Wr9E;=8yxxoE?Op&$+Q_sCNY_m zRtW?q!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g`nkoEyS{B0Jj#pJ?NtJ!}Z7sw!4^ zct>D!kax;T>$E5iyrOL;s3gXp98$K(u8r2={H>FF-x1QRY=z3iXk2S>RAOq%j<%L_ z1*O?jGR4d4Lh(>eW%4WPWYr#?QG7L>DTVxTnhPgJ>_%}Us+cg*6f0e!DlLrs2I`Sm zxM&Go8*FaEQSV60y7f3WjJC!=&3QU1>G*I44kkp=&ee#iRbeF##kK|;nqu3J1vTFa z!64B)mR$P4CRMz(9>1fhrvpA_Q=WaPek(IErkfz0CaqB;|4!EX*__K|aW1^vK#XDI`DDV-cWQOJJ zGiSt^TJ=^mhIR&9qo0oC7f{&h&Ix;lEwbr&ZHY>8C2U_hU={q!4Lk59CJdmFAkD&+k9RD{Ph!`lahej>V_P;pee zLc+wW7=pM)=P+Afo%4;eQwyD@S@;Kew%b=_eep<{d$JN%ApbU!-M8?y4r$nx&6twx zFog0FauxDOSn+wW{H}UBIQ1T*2w7SX tQdtnPq9DXqQ5aO1ucE3TRmIAJpvq;1L4~QR3dt8Hsw_-Yg;TQP^S=TF0~r7S literal 0 HcmV?d00001 diff --git a/CPP00/ex01/main.cpp b/CPP00/ex01/main.cpp new file mode 100644 index 0000000..f7a6382 --- /dev/null +++ b/CPP00/ex01/main.cpp @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: narnaud +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/06/13 09:31:46 by narnaud #+# #+# */ +/* Updated: 2022/06/13 15:16:37 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "PhoneBook.hpp" + +int main(void) +{ + PhoneBook pb; + + while (pb.run() == EXIT_SUCCESS) + ; + return (EXIT_SUCCESS); +} diff --git a/README.md b/README.md index 4db71f2..c2aa162 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,12 @@ # CPP +## Subjects : +- [CPP00](https://cdn.intra.42.fr/pdf/pdf/48426/fr.subject.pdf) + ress. +- [CPP01](https://cdn.intra.42.fr/pdf/pdf/50707/en.subject.pdf) +- [CPP02](https://cdn.intra.42.fr/pdf/pdf/48502/fr.subject.pdf) +- [CPP03](https://cdn.intra.42.fr/pdf/pdf/48500/fr.subject.pdf) +- [CPP04](https://cdn.intra.42.fr/pdf/pdf/48498/fr.subject.pdf) +- [CPP05](https://cdn.intra.42.fr/pdf/pdf/51045/fr.subject.pdf) +- [CPP06](https://cdn.intra.42.fr/pdf/pdf/48493/fr.subject.pdf) +- [CPP07](https://cdn.intra.42.fr/pdf/pdf/48487/fr.subject.pdf) + .cpp +- [CPP08](https://cdn.intra.42.fr/pdf/pdf/48485/fr.subject.pdf)