Nome in ordine inverso
Week 1: Suggestion 1 Write a program to ask a user for their name and output their name in reverse order. Such as: INPUT: James OUTPUT: semaJ.… Leggi tutto »Nome in ordine inverso
Week 1: Suggestion 1 Write a program to ask a user for their name and output their name in reverse order. Such as: INPUT: James OUTPUT: semaJ.… Leggi tutto »Nome in ordine inverso
Week 8: Graphical Write a program that will draw a regular polygon for any given number of sides. For example if the user enters 5 then the… Leggi tutto »Poligono regolare
Week 8: Text Write a program that allows the user to enter a sentence which the computer will then spell check. Hint: Use the Dictionary… Leggi tutto »Controllo ortografia 1
2012-07: Easy Math calculation Apple’s weight is 300 g. orange’s weight is 200 g. You measured the weight of the apples and oranges by analogue… Leggi tutto »Bilancia
Un’operazione aritmetica applicata a due numeri inseriti da tastiera.
1 2 3 4 5 6 |
TextWindow.Write("Primo numero: ") numero1 = TextWindow.ReadNumber() TextWindow.Write("Secondo numero: ") numero2 = TextWindow.ReadNumber() r = numero1+numero2 TextWindow.WriteLine(numero1 + " + " + numero2 + " = " + r) |
Le quattro operazioni aritmetiche Il codice
1 2 3 4 5 6 7 8 9 10 11 12 |
TextWindow.Write("Primo numero: ") numero1 = TextWindow.ReadNumber() TextWindow.Write("Secondo numero: ") numero2 = TextWindow.ReadNumber() r1 = numero1+numero2 r2 = numero1-numero2 r3 = numero1*numero2 r4 = numero1/numero2 TextWindow.WriteLine(numero1 + " + " + numero2 + " = " + r1) TextWindow.WriteLine(numero1 + " - " + numero2 + " = " + r2) TextWindow.WriteLine(numero1 + " * " + numero2 + " = " + r3) TextWindow.WriteLine(numero1 + " / " + numero2 + " = " + r4) |
Il primo programma con un po’ di colore! Il codice
1 2 3 4 5 6 |
TextWindow.BackgroundColor = "White" TextWindow.ForegroundColor = "Blue" TextWindow.WriteLine("Ciao mondo!") TextWindow.BackgroundColor = "Yellow" TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("Ciao mondo!") |
Osserva che le ultime impostazioni sono state applicate al messaggio finale Press any key… Leggi tutto »Ciao mondo con i colori
Il tuo primo programma Il codice nella finestra di testo è
1 |
TextWindow.WriteLine("Ciao mondo!") |
Esegui il codice con F5 e apparirà una finestra del terminale con la scritta… Leggi tutto »Ciao mondo – 1