diff options
| author | Mitsuo Tokumori <[email protected]> | 2023-08-18 01:57:48 -0500 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2023-08-18 01:57:48 -0500 |
| commit | 387642ff612de7d0ebf09410cd8e39a4765c877a (patch) | |
| tree | 38c6160cca0ba4cfae966a74d839dd18efdf099a /2023-2/L0 | |
| parent | 49d4392ca1972c8d66b1015f2cdda414d94812b8 (diff) | |
| download | LP1-387642ff612de7d0ebf09410cd8e39a4765c877a.tar.gz LP1-387642ff612de7d0ebf09410cd8e39a4765c877a.tar.bz2 LP1-387642ff612de7d0ebf09410cd8e39a4765c877a.zip | |
Fix naming. Add leading 0 to lab names
Diffstat (limited to '2023-2/L0')
| -rw-r--r-- | 2023-2/L0/Libros.csv | 33 | ||||
| -rw-r--r-- | 2023-2/L0/fun.cpp | 72 | ||||
| -rw-r--r-- | 2023-2/L0/fun.h | 5 | ||||
| -rw-r--r-- | 2023-2/L0/main.cpp | 21 | ||||
| -rw-r--r-- | 2023-2/L0/reporte.txt | 39 |
5 files changed, 0 insertions, 170 deletions
diff --git a/2023-2/L0/Libros.csv b/2023-2/L0/Libros.csv deleted file mode 100644 index 5097249..0000000 --- a/2023-2/L0/Libros.csv +++ /dev/null @@ -1,33 +0,0 @@ -QV96140,El Duque en su territorio,Fiorella Florencio Polo,12,37.47
-KC34197,Las demoliciones de Paris,Zkenia Chung Zuniga,10,294.26
-VA35843,L-ecole des menages,Walter Jolay Chumpitaz,14,234.01
-XN48844,The Countess de Charny,Rosario Tabori Arias,30,265.70
-IW10872,El Club de los explotadores,Cesar Rodriguez Serrano,5,263.45
-ZR63735,Elogio de la madrastra,Julio Vilcara Jugo,26,185.88
-FY25192,La hermosa jardinera,Humberto Amezquita Contreras,8,113.40
-OC73472,Le Cousin Pons,Jaime Shirakawa Florian,30,413.61
-QE47018,El Manuscrito del Domino,Raul Collado Villa,1,276.71
-UW23132,House of Pomegranates,David Perez Antezano,8,441.52
-SV17719,Le Colonel Chabert,Cinthia Zegarra Cabello,9,51.20
-SA04133,An Ideal Husband,Delicia Norabuena Zegarra,11,239.17
-SK15788,Le Chef-d oeuvre inconnu,Blanca Acuna Ayllon,22,112.52
-JO84937,Historia de Mayra,Valentina Urbina Antezano,27,53.48
-NF53199,Suspense,Emilio Gonzales Aguirre,17,367.64
-BB35881,Una Navidad,Edilberto Mori Suarez,4,32.80
-XW06135,The Nutcracker,Humberto Vargas Guevara,4,77.27
-QO90975,La Peau de chagrin,Janet Aranda Minaya,30,158.03
-TA81777,Musica para camaleones,Luz Jauregui Bravo,3,218.59
-FW74175,La Cousine Bette,Surami Preciado Pinto,18,279.44
-OT07742,La Fille aux yeux d-or,Alfonso Cabello Lam,13,195.87
-PL70268,Lady -- Windermeres Fan,Victor Garcia Astete,4,329.24
-QA53897,The Corsican Brothers,Ofelia Mercado Caro,8,62.87
-ZQ38637,La casa grade,Delicia Arca Aquino,7,214.72
-PT00038,El nino perdido,Giovana Mejia Zegarra,3,80.23
-FY82455,La guerra del fin de siglo,Milena Zarate Acuna,13,352.36
-KW25071,La Resurrección de Rocambole,Francisco Zimic Salas,4,313.22
-ZK87496,Beat the Devil,Miguel Landeo Estrada,19,178.81
-BH96036,Los tesoros del Rajah,Delicia Arca Leiva,6,360.73
-LM05731,Le Chevalier de Maison - Rouge,Yliana Ortiz Guevara,12,352.26
-XQ03477,Les Ressources de Quinola,Johan Ayala Zevallos,19,369.37
-ZM20053,The Fencing Master,Felicita Castillo Chung,5,26.41
-MG75057,Un viaje de 75 dias,Victoria Shirakawa Saona,18,350.67
diff --git a/2023-2/L0/fun.cpp b/2023-2/L0/fun.cpp deleted file mode 100644 index e317db3..0000000 --- a/2023-2/L0/fun.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include <iostream> // I/O basico (left, right, hex, oct, [no]uppercase, showbase) -#include <iomanip> // manipuladores (setw, setprecision, setfill) -#include <iostream> -#include <cstring> -#include "fun.h" - -#define MAXLEN 100 - -using namespace std; - -void leer_datos_escribir_reporte(std::istream& in, std::ostream& out) { - int sum_qty; - double sum_price; // (price * qty) - - char code[MAXLEN]; - char book_name[MAXLEN]; - char author_name[MAXLEN]; - int qty; - double unit_price; - char c; // dummy - - sum_qty = 0; - sum_price = 0.0; - print_header(out); - int i; - for (i = 0; true; i++) { - // read - in.getline(code, MAXLEN, ','); - in.getline(book_name, MAXLEN, ','); - in.getline(author_name, MAXLEN, ','); - in >> qty; - in >> c; - in >> unit_price; - in.ignore(MAXLEN, '\n'); - if (!in) { - break; - } - // process - to_upper_cstring_inplace(book_name); - sum_qty += qty; - sum_price += qty * unit_price; - - // write - out << setw(2) << right << setfill('0') << i + 1 << ") "; - out << left << setfill(' '); - out << setw(8) << code; - out << setw(32) << uppercase << book_name; - out << setw(32) << author_name; - out << right << setprecision(2) << fixed; - out << setw(4) << qty; - out << setw(4) << ' '; - out << setw(8) << unit_price; - out << '\n'; - } - - out << "\n\n"; - out << "Total cantidad libros: " << sum_qty << '\n'; - out << "Total valor libros: " << sum_price << '\n'; -} - -void print_header(ostream& out) { - // 8 32 32 4 8 - out << "No. Codigo Nombre Autor Cant. Precio \n"; - out << "----------------------------------------------------------------------------------------------\n"; -} - -void to_upper_cstring_inplace(char * s) { - int i; - for (i = 0; s[i] != '\0'; i++) { - s[i] = toupper(s[i]); - } -}
\ No newline at end of file diff --git a/2023-2/L0/fun.h b/2023-2/L0/fun.h deleted file mode 100644 index 4277ab4..0000000 --- a/2023-2/L0/fun.h +++ /dev/null @@ -1,5 +0,0 @@ -#include <iostream> - -void leer_datos_escribir_reporte(std::istream& in, std::ostream& out); -void print_header(std::ostream& out); -void to_upper_cstring_inplace(char * s);
\ No newline at end of file diff --git a/2023-2/L0/main.cpp b/2023-2/L0/main.cpp deleted file mode 100644 index fc150df..0000000 --- a/2023-2/L0/main.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Just an example of I/O with files for INF281 -// Compile with: clang++ -g main.cpp fun.cpp && ./a.out -// Mitsuo 2023-08-17 - -#include <iostream> -#include <fstream> // archivos - -#include "fun.h" - -using namespace std; - -int main(int argc, char ** argv) { - ifstream in("Libros.csv"); - if (!in) { - cerr << "Error: No se pudo abrir archivo\n"; - } - ofstream out("reporte.txt"); - leer_datos_escribir_reporte(in, out); - return 0; -} - diff --git a/2023-2/L0/reporte.txt b/2023-2/L0/reporte.txt deleted file mode 100644 index 649dda1..0000000 --- a/2023-2/L0/reporte.txt +++ /dev/null @@ -1,39 +0,0 @@ -No. Codigo Nombre Autor Cant. Precio ----------------------------------------------------------------------------------------------- -01) QV96140 EL DUQUE EN SU TERRITORIO Fiorella Florencio Polo 12 37.47 -02) KC34197 LAS DEMOLICIONES DE PARIS Zkenia Chung Zuniga 10 294.26 -03) VA35843 L-ECOLE DES MENAGES Walter Jolay Chumpitaz 14 234.01 -04) XN48844 THE COUNTESS DE CHARNY Rosario Tabori Arias 30 265.70 -05) IW10872 EL CLUB DE LOS EXPLOTADORES Cesar Rodriguez Serrano 5 263.45 -06) ZR63735 ELOGIO DE LA MADRASTRA Julio Vilcara Jugo 26 185.88 -07) FY25192 LA HERMOSA JARDINERA Humberto Amezquita Contreras 8 113.40 -08) OC73472 LE COUSIN PONS Jaime Shirakawa Florian 30 413.61 -09) QE47018 EL MANUSCRITO DEL DOMINO Raul Collado Villa 1 276.71 -10) UW23132 HOUSE OF POMEGRANATES David Perez Antezano 8 441.52 -11) SV17719 LE COLONEL CHABERT Cinthia Zegarra Cabello 9 51.20 -12) SA04133 AN IDEAL HUSBAND Delicia Norabuena Zegarra 11 239.17 -13) SK15788 LE CHEF-D OEUVRE INCONNU Blanca Acuna Ayllon 22 112.52 -14) JO84937 HISTORIA DE MAYRA Valentina Urbina Antezano 27 53.48 -15) NF53199 SUSPENSE Emilio Gonzales Aguirre 17 367.64 -16) BB35881 UNA NAVIDAD Edilberto Mori Suarez 4 32.80 -17) XW06135 THE NUTCRACKER Humberto Vargas Guevara 4 77.27 -18) QO90975 LA PEAU DE CHAGRIN Janet Aranda Minaya 30 158.03 -19) TA81777 MUSICA PARA CAMALEONES Luz Jauregui Bravo 3 218.59 -20) FW74175 LA COUSINE BETTE Surami Preciado Pinto 18 279.44 -21) OT07742 LA FILLE AUX YEUX D-OR Alfonso Cabello Lam 13 195.87 -22) PL70268 LADY -- WINDERMERES FAN Victor Garcia Astete 4 329.24 -23) QA53897 THE CORSICAN BROTHERS Ofelia Mercado Caro 8 62.87 -24) ZQ38637 LA CASA GRADE Delicia Arca Aquino 7 214.72 -25) PT00038 EL NINO PERDIDO Giovana Mejia Zegarra 3 80.23 -26) FY82455 LA GUERRA DEL FIN DE SIGLO Milena Zarate Acuna 13 352.36 -27) KW25071 LA RESURRECCIóN DE ROCAMBOLE Francisco Zimic Salas 4 313.22 -28) ZK87496 BEAT THE DEVIL Miguel Landeo Estrada 19 178.81 -29) BH96036 LOS TESOROS DEL RAJAH Delicia Arca Leiva 6 360.73 -30) LM05731 LE CHEVALIER DE MAISON - ROUGE Yliana Ortiz Guevara 12 352.26 -31) XQ03477 LES RESSOURCES DE QUINOLA Johan Ayala Zevallos 19 369.37 -32) ZM20053 THE FENCING MASTER Felicita Castillo Chung 5 26.41 -33) MG75057 UN VIAJE DE 75 DIAS Victoria Shirakawa Saona 18 350.67 - - -Total cantidad libros: 420 -Total valor libros: 97236.25 |
