Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Programmazione > PIGHIZZINI] 1° Compitino A.A.04/05
Pages (2): [1] 2 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Diuzza
.illuminato.

User info:
Registered: Aug 2004
Posts: 169 (0.02 al dì)
Location:
Corso: Informatica
Anno: 2
Time Online: 1 Day, 8:30:45 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
1° compitino prog e lab

Ci sono 2 versioni: Io pubblico la mia.

1)Creare un programma che trovi il numero delle differenze tra due stringhe in base alla lunghezza e difersità dei caratteri.
Ad esempio tra paperino e paparino il carattere differente è uno cioè pap(e)rino e pap(a)rino. Invece tra papero e paparino sono pap(a)r(ino) cioè 4.


2)!(x>--y)&&(x--==3)
Dire che valori assumono x e y e il valore dell'equazione se all'inizio assumevano i seguenti valori:
a)x=3 Y=3
b)x=3 y=4


3)!(a>1 || b==2 || c<3)
Scrivere quest'equazione senza usare il negato iniziale

29-10-2004 10:18
Click Here to See the Profile for Diuzza Click here to Send Diuzza a Private Message Find more posts by Diuzza Add Diuzza to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Diuzza
.illuminato.

User info:
Registered: Aug 2004
Posts: 169 (0.02 al dì)
Location:
Corso: Informatica
Anno: 2
Time Online: 1 Day, 8:30:45 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

4)
int x=3, y=4;
if (x==(y=3))
x=y-x;
else
x=y/x

Che valori assumono x e y


5)
int i=5, j=1;
for( int k=0; k<i+j; k++) {
i-=1;
if (k==i-j)
break
j +=1;
}

Che valori assumono k i j all'uscita dal for

29-10-2004 10:22
Click Here to See the Profile for Diuzza Click here to Send Diuzza a Private Message Find more posts by Diuzza Add Diuzza to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Diuzza
.illuminato.

User info:
Registered: Aug 2004
Posts: 169 (0.02 al dì)
Location:
Corso: Informatica
Anno: 2
Time Online: 1 Day, 8:30:45 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

6) (x==y)?!x:!y
Questa equazione è fattibile e che tipi di variabili sono x e y

7)Descrivere brevemente le funzioni del linker

29-10-2004 10:24
Click Here to See the Profile for Diuzza Click here to Send Diuzza a Private Message Find more posts by Diuzza Add Diuzza to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Diuzza
.illuminato.

User info:
Registered: Aug 2004
Posts: 169 (0.02 al dì)
Location:
Corso: Informatica
Anno: 2
Time Online: 1 Day, 8:30:45 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Comunque l'altra versione era strutturata allo stesso modo ma con solo qualche valore differente

29-10-2004 10:28
Click Here to See the Profile for Diuzza Click here to Send Diuzza a Private Message Find more posts by Diuzza Add Diuzza to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Diuzza
.illuminato.

User info:
Registered: Aug 2004
Posts: 169 (0.02 al dì)
Location:
Corso: Informatica
Anno: 2
Time Online: 1 Day, 8:30:45 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Le soluzioni non le pubblico che magari sono sbagliate

29-10-2004 10:48
Click Here to See the Profile for Diuzza Click here to Send Diuzza a Private Message Find more posts by Diuzza Add Diuzza to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.03 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
operatori unari

raga io non ho capito questo:
a=4, b=8
calcolare i valori che assumono a e b dopo queste istruzioni:

a = a++ + --b;
allora a++ incrementa di uno quindi 4+1=5 e --b decrementa di uno quindi 8-1=7 -->b=7
a=5+7=12 ERRORE!!! il risultato corretto è 11 ma non riesco a capire perchè... so che il trucchetto sta nel fatto che l'operatore -- sulla b è prefisso , ma non capisco come possa venire 11!!

e poi:
b+=a-b;
non è la stessa cosa che scrivere b=b+a-b?? quindi verrebbe 4 perchè 8+4-8=4... dovrebbe venire anche qui 11!! ma perchè???
voi avete capito??:-o
grazie in anticipo :-D

__________________
Live Fast, Die Fun

04-11-2004 15:14
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
loreste
.grande:maestro.

User info:
Registered: Jan 2003
Posts: 730 (0.09 al dì)
Location: Berghem
Corso: Informatica
Anno: -2 alla specialistica
Time Online: 8 Days, 5:47:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Risulta è 11 perche a = 4 b = 8
con
a = a++ tu usi il valore 4 e dopo viene incrementata la variabile a
mentre con --b prima decrementi poi usi il valore

percui
a = 4 + 7 = 11
se tu avessi avuto
s = a++ + --b
avresti ottenuto
S = 11 a= 5 b = 7

Sono stato chiaro? :?

__________________
La Fede non retrocede mai!
Döma Atalanta!!!!!!!!

04-11-2004 15:49
Click Here to See the Profile for loreste Click here to Send loreste a Private Message Find more posts by loreste Add loreste to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
loreste
.grande:maestro.

User info:
Registered: Jan 2003
Posts: 730 (0.09 al dì)
Location: Berghem
Corso: Informatica
Anno: -2 alla specialistica
Time Online: 8 Days, 5:47:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by loreste
Risulta è 11 perche a = 4 b = 8

Ho sbagliato
Risulta 11 perche inizialmente hai a = 5 b=8

__________________
La Fede non retrocede mai!
Döma Atalanta!!!!!!!!

04-11-2004 15:51
Click Here to See the Profile for loreste Click here to Send loreste a Private Message Find more posts by loreste Add loreste to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alececk84
.fò:preciis.

User info:
Registered: Oct 2003
Posts: 1656 (0.21 al dì)
Location: Bocch dol ràt
Corso: Informatica
Anno: Almeno dodès
Time Online: 17 Days, 6:52:23 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: operatori unari

Originally posted by ste182
raga io non ho capito questo:
a=4, b=8
calcolare i valori che assumono a e b dopo queste istruzioni:

a = a++ + --b;
allora a++ incrementa di uno quindi 4+1=5 e --b decrementa di uno quindi 8-1=7 -->b=7
a=5+7=12 ERRORE!!! il risultato corretto è 11 ma non riesco a capire perchè... so che il trucchetto sta nel fatto che l'operatore -- sulla b è prefisso , ma non capisco come possa venire 11!!

e poi:
b+=a-b;
non è la stessa cosa che scrivere b=b+a-b?? quindi verrebbe 4 perchè 8+4-8=4... dovrebbe venire anche qui 11!! ma perchè???
voi avete capito??:-o
grazie in anticipo :-D


Nell'espressione a = a++ + --b
Il valore di a viene incrementato dopo aver fatto la somma dato che l'operatore ++ è suffisso
Il valore di b viene decrementato prima di fare la somma dato che l'operatore -- è prefisso
quindi alla fine avrai
b=7
a=11

Nell'espressione b+=a-b
E' equivalente a b=b+a-b
Cioè b=a
Quindi b=11

Alla fine
a=11
b=11

Se i due esercizi sono collegati allora dovrebbe essere così...altrimenti non so come possa venire b=11 nel secondo:?

__________________
Se Ghe L'ìo Me La Dào - MLCM
Corri corri ragazzo ribelle fuma e bevi sotto le stelle...ma non bucare mai la tua pelle se no le stelle non le vedi più...
De bei come nuun la mam la n'en fa più...'lsa rot la machineta e al pà 'lghe tira più...
MY SITE - MY BLOG- MY FOTO ALBUM - MSN: alececk84@hotmail.it

04-11-2004 16:11
Click Here to See the Profile for Alececk84 Click Here to See the Blog of Alececk84 Click here to Send Alececk84 a Private Message Visit Alececk84's homepage! Find more posts by Alececk84 Add Alececk84 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.03 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok grazie ho capito :-D ... si gli esercizi erano collegati... cmq io ho studiato c++ alle superiori e mi pare di ricordare che se facevo una cosa del tipo:
valore iniziale --> cont = 30;

numero = cont++;

la variabile numero dopo questa istruzione valeva 31
invece mi pare di capire che in java, numero vale 30 e cont 31 o sbaglio?

__________________
Live Fast, Die Fun

04-11-2004 17:28
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alececk84
.fò:preciis.

User info:
Registered: Oct 2003
Posts: 1656 (0.21 al dì)
Location: Bocch dol ràt
Corso: Informatica
Anno: Almeno dodès
Time Online: 17 Days, 6:52:23 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Anche in c++ dovrebbe essere così...ma non mi ricordo più niente di C...non so...

__________________
Se Ghe L'ìo Me La Dào - MLCM
Corri corri ragazzo ribelle fuma e bevi sotto le stelle...ma non bucare mai la tua pelle se no le stelle non le vedi più...
De bei come nuun la mam la n'en fa più...'lsa rot la machineta e al pà 'lghe tira più...
MY SITE - MY BLOG- MY FOTO ALBUM - MSN: alececk84@hotmail.it

04-11-2004 17:46
Click Here to See the Profile for Alececk84 Click Here to See the Blog of Alececk84 Click here to Send Alececk84 a Private Message Visit Alececk84's homepage! Find more posts by Alececk84 Add Alececk84 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
loreste
.grande:maestro.

User info:
Registered: Jan 2003
Posts: 730 (0.09 al dì)
Location: Berghem
Corso: Informatica
Anno: -2 alla specialistica
Time Online: 8 Days, 5:47:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ste182
ok grazie ho capito :-D ... si gli esercizi erano collegati... cmq io ho studiato c++ alle superiori e mi pare di ricordare che se facevo una cosa del tipo:
valore iniziale --> cont = 30;

numero = cont++;

la variabile numero dopo questa istruzione valeva 31
invece mi pare di capire che in java, numero vale 30 e cont 31 o sbaglio?

Secondo me è cosi in Java ed è cosi in C++, infonfo Java a copiato la sintassi da c++

__________________
La Fede non retrocede mai!
Döma Atalanta!!!!!!!!

04-11-2004 17:57
Click Here to See the Profile for loreste Click here to Send loreste a Private Message Find more posts by loreste Add loreste to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.03 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si vero.. è così anche in c++, ho provato poco fa... azz mi sono un pò arrugginito eheheheheheh:D

__________________
Live Fast, Die Fun

04-11-2004 18:01
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
123
.precettore.

User info:
Registered: Aug 2004
Posts: 84 (0.01 al dì)
Location: albignano (ridicolo paesello di provincia)
Corso: informatica
Anno: 3
Time Online: 11 Days, 12:49:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

io sono dell'altro turno ma visto che se ne parla ho un dubbio:

ma in un espressione del tipo
x=++a*b-- +1
quale operatore viene valutato prima e quale per secondo? il ++ prefisso ad a o il -- postfisso a b. Sul sito dell'alberti c'era questa domanda nel compitino dell'anno scorso e nelle soluzioni dice che viene valutato prima il ++ e poi il -- (http://homes.dico.unimi.it/~alberti..._comp_1_03.html)Ma nella tabella delle precedenze(http://homes.dico.unimi.it/~alberti...precedenze.html) gli operatori postfissi vengono messi più in alto di quelli prefissi. Sbaglio a leggere la tabella?? Come si deve leggere?

04-11-2004 18:37
Click Here to See the Profile for 123 Click here to Send 123 a Private Message Find more posts by 123 Add 123 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alececk84
.fò:preciis.

User info:
Registered: Oct 2003
Posts: 1656 (0.21 al dì)
Location: Bocch dol ràt
Corso: Informatica
Anno: Almeno dodès
Time Online: 17 Days, 6:52:23 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Viene valutato il ++ poi il * il + e infine il --

__________________
Se Ghe L'ìo Me La Dào - MLCM
Corri corri ragazzo ribelle fuma e bevi sotto le stelle...ma non bucare mai la tua pelle se no le stelle non le vedi più...
De bei come nuun la mam la n'en fa più...'lsa rot la machineta e al pà 'lghe tira più...
MY SITE - MY BLOG- MY FOTO ALBUM - MSN: alececk84@hotmail.it

04-11-2004 22:59
Click Here to See the Profile for Alececk84 Click Here to See the Blog of Alececk84 Click here to Send Alececk84 a Private Message Visit Alececk84's homepage! Find more posts by Alececk84 Add Alececk84 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 05:56.    Post New Thread    Post A Reply
Pages (2): [1] 2 »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.045 seconds (81.81% PHP - 18.19% MySQL) con 28 query.