SlideShare a Scribd company logo
1 of 4
Download to read offline
//*********************************************************
// VowelCount.java
//
// This program counts the number of vowels in a string
//*********************************************************
import java.util.Scanner;
public class VowelCount {
public static void main(String[] args) {
/*
* declare variables to store the number of each type of vowel
*/
int countA = 0, countE = 0, countI = 0, countO = 0, countU = 0;
Scanner scan = new Scanner(System.in);
// Get the string from the user (prompt and input)
System.out.println("Enter a string of characters:");
String str = scan.nextLine();
// format for this part:
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i)) {
case 'a':
case 'A':
countA++;
break;
case 'e':
case 'E':
countE++;
break;
case 'i':
case 'I':
countI++;
break;
case 'o':
case 'O':
countO++;
break;
case 'u':
case 'U':
countU++;
break;
default:
break;
}
}
/*
* Remember: 1) condition should use method for getting string length 2)
* exp (in switch) should use method for returning a character
*/
// Output results
System.out.println("Number of each vowel in the string: a: " + countA
+ " e: " + countE + " i: " + countI + " o: " + countO
+ " u: " + countU);
}
}
OUTPUT:
Enter a string of characters:
Hello! I am Finn from the land of Ooo.
Number of each vowel in the string:
a: 2
e: 2
i: 2
o: 6
u: 0
Solution
//*********************************************************
// VowelCount.java
//
// This program counts the number of vowels in a string
//*********************************************************
import java.util.Scanner;
public class VowelCount {
public static void main(String[] args) {
/*
* declare variables to store the number of each type of vowel
*/
int countA = 0, countE = 0, countI = 0, countO = 0, countU = 0;
Scanner scan = new Scanner(System.in);
// Get the string from the user (prompt and input)
System.out.println("Enter a string of characters:");
String str = scan.nextLine();
// format for this part:
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i)) {
case 'a':
case 'A':
countA++;
break;
case 'e':
case 'E':
countE++;
break;
case 'i':
case 'I':
countI++;
break;
case 'o':
case 'O':
countO++;
break;
case 'u':
case 'U':
countU++;
break;
default:
break;
}
}
/*
* Remember: 1) condition should use method for getting string length 2)
* exp (in switch) should use method for returning a character
*/
// Output results
System.out.println("Number of each vowel in the string: a: " + countA
+ " e: " + countE + " i: " + countI + " o: " + countO
+ " u: " + countU);
}
}
OUTPUT:
Enter a string of characters:
Hello! I am Finn from the land of Ooo.
Number of each vowel in the string:
a: 2
e: 2
i: 2
o: 6
u: 0

More Related Content

Similar to Vo.pdf

The java program that prompts user to enter a string and .pdf
  The java program that prompts user to  enter a string and .pdf  The java program that prompts user to  enter a string and .pdf
The java program that prompts user to enter a string and .pdfDEEPAKSONI562
 
MagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdfMagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdfanjanacottonmills
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...Hiraniahmad
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...Hiraniahmad
 
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfannapurnnatextailes
 
Objective Min-heap queue with customized comparatorHospital emerg.pdf
Objective Min-heap queue with customized comparatorHospital emerg.pdfObjective Min-heap queue with customized comparatorHospital emerg.pdf
Objective Min-heap queue with customized comparatorHospital emerg.pdfezhilvizhiyan
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming AssignmentCoding Assignment Help
 
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdfg++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdfarakalamkah11
 
Bubba.java import java.util.Scanner;package for keyboard input.pdf
Bubba.java import java.util.Scanner;package for keyboard input.pdfBubba.java import java.util.Scanner;package for keyboard input.pdf
Bubba.java import java.util.Scanner;package for keyboard input.pdfanupamfootwear
 
import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdfangelsfashion1
 
The java program that simulates ATM operations. The prog.pdf
  The java program that simulates ATM operations.  The prog.pdf  The java program that simulates ATM operations.  The prog.pdf
The java program that simulates ATM operations. The prog.pdfpoddaranand1
 
(In java language)1. Use recursion in implementing the binarySearc.pdf
(In java language)1. Use recursion in implementing the binarySearc.pdf(In java language)1. Use recursion in implementing the binarySearc.pdf
(In java language)1. Use recursion in implementing the binarySearc.pdfrbjain2007
 

Similar to Vo.pdf (14)

The java program that prompts user to enter a string and .pdf
  The java program that prompts user to  enter a string and .pdf  The java program that prompts user to  enter a string and .pdf
The java program that prompts user to enter a string and .pdf
 
MagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdfMagicSquareTest.java import java.util.Scanner;public class Mag.pdf
MagicSquareTest.java import java.util.Scanner;public class Mag.pdf
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...
 
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
 
Objective Min-heap queue with customized comparatorHospital emerg.pdf
Objective Min-heap queue with customized comparatorHospital emerg.pdfObjective Min-heap queue with customized comparatorHospital emerg.pdf
Objective Min-heap queue with customized comparatorHospital emerg.pdf
 
Taking User Input in Java
Taking User Input in JavaTaking User Input in Java
Taking User Input in Java
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming Assignment
 
Test Program - Basic operators
Test Program - Basic operatorsTest Program - Basic operators
Test Program - Basic operators
 
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdfg++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
 
Bubba.java import java.util.Scanner;package for keyboard input.pdf
Bubba.java import java.util.Scanner;package for keyboard input.pdfBubba.java import java.util.Scanner;package for keyboard input.pdf
Bubba.java import java.util.Scanner;package for keyboard input.pdf
 
import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdf
 
The java program that simulates ATM operations. The prog.pdf
  The java program that simulates ATM operations.  The prog.pdf  The java program that simulates ATM operations.  The prog.pdf
The java program that simulates ATM operations. The prog.pdf
 
(In java language)1. Use recursion in implementing the binarySearc.pdf
(In java language)1. Use recursion in implementing the binarySearc.pdf(In java language)1. Use recursion in implementing the binarySearc.pdf
(In java language)1. Use recursion in implementing the binarySearc.pdf
 

More from ravikapoorindia

1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf
1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf
1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdfravikapoorindia
 
1. According to morphological species concept focus on external phys.pdf
1. According to morphological species concept focus on external phys.pdf1. According to morphological species concept focus on external phys.pdf
1. According to morphological species concept focus on external phys.pdfravikapoorindia
 
1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf
1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf
1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdfravikapoorindia
 
Viral genomes may be circular, as in the polyomaviruses, or linear, .pdf
Viral genomes may be circular, as in the polyomaviruses, or linear, .pdfViral genomes may be circular, as in the polyomaviruses, or linear, .pdf
Viral genomes may be circular, as in the polyomaviruses, or linear, .pdfravikapoorindia
 
True. gaps are the reason for electrical conductivity.Solution.pdf
True. gaps are the reason for electrical conductivity.Solution.pdfTrue. gaps are the reason for electrical conductivity.Solution.pdf
True. gaps are the reason for electrical conductivity.Solution.pdfravikapoorindia
 
This is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdf
This is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdfThis is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdf
This is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdfravikapoorindia
 
The Vestibular System, which is a contributed to our balance system .pdf
The Vestibular System, which is a contributed to our balance system .pdfThe Vestibular System, which is a contributed to our balance system .pdf
The Vestibular System, which is a contributed to our balance system .pdfravikapoorindia
 
The inherent risk for an assertion about a derivative is its suscept.pdf
The inherent risk for an assertion about a derivative is its suscept.pdfThe inherent risk for an assertion about a derivative is its suscept.pdf
The inherent risk for an assertion about a derivative is its suscept.pdfravikapoorindia
 
Solution I ) Average inventory = $610,000 5 = $122000Total Inven.pdf
Solution I ) Average inventory = $610,000  5 = $122000Total Inven.pdfSolution I ) Average inventory = $610,000  5 = $122000Total Inven.pdf
Solution I ) Average inventory = $610,000 5 = $122000Total Inven.pdfravikapoorindia
 
1 D2 the decrease in entropy of the system is offset by an incr.pdf
1 D2  the decrease in entropy of the system is offset by an incr.pdf1 D2  the decrease in entropy of the system is offset by an incr.pdf
1 D2 the decrease in entropy of the system is offset by an incr.pdfravikapoorindia
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfravikapoorindia
 
NaCl + H2OSolutionNaCl + H2O.pdf
NaCl + H2OSolutionNaCl + H2O.pdfNaCl + H2OSolutionNaCl + H2O.pdf
NaCl + H2OSolutionNaCl + H2O.pdfravikapoorindia
 
Miller is US based investor and co-founder and current chairman of U.pdf
Miller is US based investor and co-founder and current chairman of U.pdfMiller is US based investor and co-founder and current chairman of U.pdf
Miller is US based investor and co-founder and current chairman of U.pdfravikapoorindia
 
Marijuana plant belongs to the genus Cannabis. It is native to the C.pdf
Marijuana plant belongs to the genus Cannabis. It is native to the C.pdfMarijuana plant belongs to the genus Cannabis. It is native to the C.pdf
Marijuana plant belongs to the genus Cannabis. It is native to the C.pdfravikapoorindia
 
InheritenceJava supports inheritance and thus, variables and metho.pdf
InheritenceJava supports inheritance and thus, variables and metho.pdfInheritenceJava supports inheritance and thus, variables and metho.pdf
InheritenceJava supports inheritance and thus, variables and metho.pdfravikapoorindia
 
It is the temporal lobe of cerebrum. It is situated beneath the late.pdf
It is the temporal lobe of cerebrum. It is situated beneath the late.pdfIt is the temporal lobe of cerebrum. It is situated beneath the late.pdf
It is the temporal lobe of cerebrum. It is situated beneath the late.pdfravikapoorindia
 
In cat,The ductus deferens also called the vas deferens leaves the t.pdf
In cat,The ductus deferens also called the vas deferens leaves the t.pdfIn cat,The ductus deferens also called the vas deferens leaves the t.pdf
In cat,The ductus deferens also called the vas deferens leaves the t.pdfravikapoorindia
 
LeadCarbonate PbCO3 is ionic compound. electrostaticforces.pdf
  LeadCarbonate  PbCO3 is ionic compound. electrostaticforces.pdf  LeadCarbonate  PbCO3 is ionic compound. electrostaticforces.pdf
LeadCarbonate PbCO3 is ionic compound. electrostaticforces.pdfravikapoorindia
 
Lithium has 3 electrons. Since an s orbital only .pdf
                     Lithium has 3 electrons. Since an s orbital only .pdf                     Lithium has 3 electrons. Since an s orbital only .pdf
Lithium has 3 electrons. Since an s orbital only .pdfravikapoorindia
 
IO3- only exhibitsresonance ,since the lone pairs.pdf
                     IO3- only exhibitsresonance ,since the lone pairs.pdf                     IO3- only exhibitsresonance ,since the lone pairs.pdf
IO3- only exhibitsresonance ,since the lone pairs.pdfravikapoorindia
 

More from ravikapoorindia (20)

1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf
1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf
1.The Excavata includes taxa that are photosynthetic, parasitic, sym.pdf
 
1. According to morphological species concept focus on external phys.pdf
1. According to morphological species concept focus on external phys.pdf1. According to morphological species concept focus on external phys.pdf
1. According to morphological species concept focus on external phys.pdf
 
1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf
1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf
1)calcium(pH-dependent regulation of lysosomal calcium in macrophage.pdf
 
Viral genomes may be circular, as in the polyomaviruses, or linear, .pdf
Viral genomes may be circular, as in the polyomaviruses, or linear, .pdfViral genomes may be circular, as in the polyomaviruses, or linear, .pdf
Viral genomes may be circular, as in the polyomaviruses, or linear, .pdf
 
True. gaps are the reason for electrical conductivity.Solution.pdf
True. gaps are the reason for electrical conductivity.Solution.pdfTrue. gaps are the reason for electrical conductivity.Solution.pdf
True. gaps are the reason for electrical conductivity.Solution.pdf
 
This is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdf
This is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdfThis is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdf
This is an example of a Lewis Acid. The CO2 acts like an acid becaus.pdf
 
The Vestibular System, which is a contributed to our balance system .pdf
The Vestibular System, which is a contributed to our balance system .pdfThe Vestibular System, which is a contributed to our balance system .pdf
The Vestibular System, which is a contributed to our balance system .pdf
 
The inherent risk for an assertion about a derivative is its suscept.pdf
The inherent risk for an assertion about a derivative is its suscept.pdfThe inherent risk for an assertion about a derivative is its suscept.pdf
The inherent risk for an assertion about a derivative is its suscept.pdf
 
Solution I ) Average inventory = $610,000 5 = $122000Total Inven.pdf
Solution I ) Average inventory = $610,000  5 = $122000Total Inven.pdfSolution I ) Average inventory = $610,000  5 = $122000Total Inven.pdf
Solution I ) Average inventory = $610,000 5 = $122000Total Inven.pdf
 
1 D2 the decrease in entropy of the system is offset by an incr.pdf
1 D2  the decrease in entropy of the system is offset by an incr.pdf1 D2  the decrease in entropy of the system is offset by an incr.pdf
1 D2 the decrease in entropy of the system is offset by an incr.pdf
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
 
NaCl + H2OSolutionNaCl + H2O.pdf
NaCl + H2OSolutionNaCl + H2O.pdfNaCl + H2OSolutionNaCl + H2O.pdf
NaCl + H2OSolutionNaCl + H2O.pdf
 
Miller is US based investor and co-founder and current chairman of U.pdf
Miller is US based investor and co-founder and current chairman of U.pdfMiller is US based investor and co-founder and current chairman of U.pdf
Miller is US based investor and co-founder and current chairman of U.pdf
 
Marijuana plant belongs to the genus Cannabis. It is native to the C.pdf
Marijuana plant belongs to the genus Cannabis. It is native to the C.pdfMarijuana plant belongs to the genus Cannabis. It is native to the C.pdf
Marijuana plant belongs to the genus Cannabis. It is native to the C.pdf
 
InheritenceJava supports inheritance and thus, variables and metho.pdf
InheritenceJava supports inheritance and thus, variables and metho.pdfInheritenceJava supports inheritance and thus, variables and metho.pdf
InheritenceJava supports inheritance and thus, variables and metho.pdf
 
It is the temporal lobe of cerebrum. It is situated beneath the late.pdf
It is the temporal lobe of cerebrum. It is situated beneath the late.pdfIt is the temporal lobe of cerebrum. It is situated beneath the late.pdf
It is the temporal lobe of cerebrum. It is situated beneath the late.pdf
 
In cat,The ductus deferens also called the vas deferens leaves the t.pdf
In cat,The ductus deferens also called the vas deferens leaves the t.pdfIn cat,The ductus deferens also called the vas deferens leaves the t.pdf
In cat,The ductus deferens also called the vas deferens leaves the t.pdf
 
LeadCarbonate PbCO3 is ionic compound. electrostaticforces.pdf
  LeadCarbonate  PbCO3 is ionic compound. electrostaticforces.pdf  LeadCarbonate  PbCO3 is ionic compound. electrostaticforces.pdf
LeadCarbonate PbCO3 is ionic compound. electrostaticforces.pdf
 
Lithium has 3 electrons. Since an s orbital only .pdf
                     Lithium has 3 electrons. Since an s orbital only .pdf                     Lithium has 3 electrons. Since an s orbital only .pdf
Lithium has 3 electrons. Since an s orbital only .pdf
 
IO3- only exhibitsresonance ,since the lone pairs.pdf
                     IO3- only exhibitsresonance ,since the lone pairs.pdf                     IO3- only exhibitsresonance ,since the lone pairs.pdf
IO3- only exhibitsresonance ,since the lone pairs.pdf
 

Recently uploaded

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

Vo.pdf

  • 1. //********************************************************* // VowelCount.java // // This program counts the number of vowels in a string //********************************************************* import java.util.Scanner; public class VowelCount { public static void main(String[] args) { /* * declare variables to store the number of each type of vowel */ int countA = 0, countE = 0, countI = 0, countO = 0, countU = 0; Scanner scan = new Scanner(System.in); // Get the string from the user (prompt and input) System.out.println("Enter a string of characters:"); String str = scan.nextLine(); // format for this part: for (int i = 0; i < str.length(); i++) { switch (str.charAt(i)) { case 'a': case 'A': countA++; break; case 'e': case 'E': countE++; break; case 'i': case 'I': countI++; break; case 'o': case 'O': countO++; break;
  • 2. case 'u': case 'U': countU++; break; default: break; } } /* * Remember: 1) condition should use method for getting string length 2) * exp (in switch) should use method for returning a character */ // Output results System.out.println("Number of each vowel in the string: a: " + countA + " e: " + countE + " i: " + countI + " o: " + countO + " u: " + countU); } } OUTPUT: Enter a string of characters: Hello! I am Finn from the land of Ooo. Number of each vowel in the string: a: 2 e: 2 i: 2 o: 6 u: 0 Solution //********************************************************* // VowelCount.java // // This program counts the number of vowels in a string //********************************************************* import java.util.Scanner;
  • 3. public class VowelCount { public static void main(String[] args) { /* * declare variables to store the number of each type of vowel */ int countA = 0, countE = 0, countI = 0, countO = 0, countU = 0; Scanner scan = new Scanner(System.in); // Get the string from the user (prompt and input) System.out.println("Enter a string of characters:"); String str = scan.nextLine(); // format for this part: for (int i = 0; i < str.length(); i++) { switch (str.charAt(i)) { case 'a': case 'A': countA++; break; case 'e': case 'E': countE++; break; case 'i': case 'I': countI++; break; case 'o': case 'O': countO++; break; case 'u': case 'U': countU++; break; default: break; }
  • 4. } /* * Remember: 1) condition should use method for getting string length 2) * exp (in switch) should use method for returning a character */ // Output results System.out.println("Number of each vowel in the string: a: " + countA + " e: " + countE + " i: " + countI + " o: " + countO + " u: " + countU); } } OUTPUT: Enter a string of characters: Hello! I am Finn from the land of Ooo. Number of each vowel in the string: a: 2 e: 2 i: 2 o: 6 u: 0