CMPS 260Projects
Programming
CMPS
5 & 6260
(1Projects
&Programming
2) _ Java
5 & 6Practice
(1Projects
& 2) Questions
_ Java
5 & 6Practice
(1&&Solutions
2) Questions
_ Java_Practice
Latest
& Solutions
2026_2027
Questions
_ Latest
&
Update.pdf
Solutions
2026_2027
_ Latest
Update.pdf
2026_2027 Update.pdf
CMPS 260 Programming Projects 5 & 6
(1 & 2) | Java Practice Questions &
Solutions | Latest 2026/2027 Update
CMPS 260 Programming
CMPS 260Projects
Programming
CMPS
5 & 6260
(1Projects
&Programming
2) _ Java
5 & 6Practice
(1Projects
& 2) Questions
_ Java
5 & 6Practice
(1&&Solutions
2) Questions
_ Java_Practice
Latest
& Solutions
2026_2027
Questions
_ Latest
&
Update.pdf
Solutions
2026_2027
_ Latest
Update.pdf
2026_2027 Update.pdf
, CMPS 260 programming projects 5 and 6(1 & 2).pdf CMPS 260 programming projects 5 and 6(1 & 2).pdf CMPS 260 programming projects 5 and 6(1 & 2).pdf
Assume letters A, E, I, O, and U as the vowels.
Write a program that prompts the user to enter a string and displays the number of vowels
and consonants in the string.
Sample Run:
Enter a string: Programming is fun
The number of vowels is 5
The number of consonants is 11
Class Name: Exercise05_49
import java.util.Scanner;
public class Exercise05_49 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter a string: ");
String s = input.nextLine();
int countVowels = 0;
int countConsonants = 0;
for (int i = 0; i < s.length(); i++) {
CMPS 260 programming projects 5 and 6(1 & 2).pdf CMPS 260 programming projects 5 and 6(1 & 2).pdf CMPS 260 programming projects 5 and 6(1 & 2).pdf