fondamenti di informatica 1 esercizi di riepilogo
TRANSCRIPT
![Page 1: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/1.jpg)
Fondamenti di Informatica
1
Esercizi di riepilogo
![Page 2: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/2.jpg)
Fondamenti di Informatica
2
MNP5
0010000000110110110110100010010110000
![Page 3: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/3.jpg)
Fondamenti di Informatica
3
MNP5
0010000000110110110110100010010110000
00000000 000 000000001 000 100000010 001 000000011 001 100000100 010 0000000101 010 0100000110 010 1000000111 010 1100001000 011 00000001001 011 00100001010 011 01000001011 011 01100001100 011 100... ...
![Page 4: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/4.jpg)
Fondamenti di Informatica
4
Puntatori
![Page 5: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/5.jpg)
Fondamenti di Informatica
5
![Page 6: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/6.jpg)
Fondamenti di Informatica
6
TXT2PHONE
![Page 7: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/7.jpg)
Fondamenti di Informatica
7
TXT2PHONE
• Lettura file (fgets): per ogni riga– Estrazione dati
• struct con:– nome compagnia– numero in forma testuale
– Conversione stringa numero da forma testuale a cifre
– Scrittura riga nel file di uscita
![Page 8: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/8.jpg)
Fondamenti di Informatica
8
TXT2PHONEchar txt2digit (char ch){ char phone_text_table ['z' - 'a' + 1] = { '2', '2', '2', /* abc */ '3', '3', '3', /* def */ '4', '4', '4', /* ghi */ '5', '5', '5', /* jkl */ '6', '6', '6', /* mno */ '7', '7', '7', '7', /* pqrs */ '8', '8', '8', /* tuv */ '9', '9', '9', '9' /* wxyz */ };
return phone_text_table[tolower(ch) - 'a'];}
![Page 9: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/9.jpg)
Fondamenti di Informatica
9
TXT2PHONEvoid txt2phone (char s[], char t[]){ int i = 0, j = 0;
while (s[i] != '\0') { if (s[i] >= '0' && s[i] <= '9') t[j++] = s[i++]; else if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z')) t[j++] = txt2digit (s[i++]); else i++; } t[j] = '\0'; return;}
![Page 10: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/10.jpg)
Fondamenti di Informatica
10
Noise gate
![Page 11: Fondamenti di Informatica 1 Esercizi di riepilogo](https://reader037.vdocuments.net/reader037/viewer/2022102817/56649c715503460f94922cfb/html5/thumbnails/11.jpg)
Fondamenti di Informatica
11