Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PP.6.1
import java.util.Scanner;
}//end printnumber
}
PP.6.2
import java.util.Scanner;
}
}
PP.6.3
public class PP63 {
}
PP.6.4
import java.util.Scanner;
}
}
}
PP.6.6
public class Stars
{
public static void main (String[] args)
{
final int MAX_ROWS = 10;
for (int row = 1; row <= MAX_ROWS; row++)
{
for (int star = 10; star >= row; star--)
System.out.print ("*");
System.out.println();
}
}
}
PP.6.8
import java.util.Scanner;
public class VowelAnalyst{
public static void main(String args [])
{
int a =0, e = 0, x = 0;
int u = 0, o = 0, other = 0;
String text;
Scanner scan = new Scanner(System.in);
System.out.print("enter string: ");
text = scan.nextLine();
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c=='a')
a++;
else if( c=='e')
e++;
else if(c=='i')
x++;
else if(c=='o')
o++;
else if (c=='u')
u++;
else
other++;
}