SlideShare a Scribd company logo
1 of 3
All the methods are completed.
Write a class named WordCruncherTest that has only a main method that:
The program should continue to do this until the user enters the word "quit"
Solution
import static java.lang.System.exit;
import java.util.Scanner;
class WordCruncherTest
{
public static void main(String args[])
{
Scanner m=new Scanner(System.in);
String option = "";
option=m.next();
if(option.equals("quit"))
{
System.out.println("bye");
exit(0);
}
else
{
int[] alphabetArray = new int[26];int coun=0;
for ( int i = 0; i < option.length(); i++ ) {
char ch= option.charAt(i);
int value = (int) ch;
if (value >= 97 && value <= 122){
alphabetArray[ch-'a']++;
coun++;
}
}
for (int i = 0; i < alphabetArray.length; i++) {
if(alphabetArray[i]>0){
char ch = (char) (i+97);
System.out.println(" occurences : "+ch+" "+alphabetArray[i]+"");Â Â //Show the result.
}
}
System.out.println("number of letters are"+coun);
char[] try1= option.toCharArray();
System.out.println("string reverse");
for (int i=try1.length-1;i>=0;i--)
System.out.print(try1[i]);
System.out.println("");
int count=0;
for (int i = 0; i < option.length(); i++) {
char ch = option.charAt(i);
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch ==
'I' || ch == 'O' || ch == 'U') {
count++;
}
}
System.out.println("Number of vowels : " + count);
}
}
}

More Related Content

Similar to All the methods are completed- Write a class named WordCruncherTest th.docx

import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfanurag1231
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Ayes Chinmay
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfrajeshjangid1865
 
Practice programs
Practice programsPractice programs
Practice programsAbbott
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfankkitextailes
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfmayorothenguyenhob69
 

Similar to All the methods are completed- Write a class named WordCruncherTest th.docx (15)

Xamarin: C# Methods
Xamarin: C# MethodsXamarin: C# Methods
Xamarin: C# Methods
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 
07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdf
 
Java practical
Java practicalJava practical
Java practical
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
 
Methods intro-1.0
Methods intro-1.0Methods intro-1.0
Methods intro-1.0
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdf
 
Practice programs
Practice programsPractice programs
Practice programs
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
 

More from lauracallander

Match the cell structure with the cell function- - Plasma Membrane A-.docx
Match the cell structure with the cell function- - Plasma Membrane A-.docxMatch the cell structure with the cell function- - Plasma Membrane A-.docx
Match the cell structure with the cell function- - Plasma Membrane A-.docxlauracallander
 
Matrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docx
Matrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docxMatrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docx
Matrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docxlauracallander
 
Modify function partition so that it groups together all elements dupl.docx
Modify function partition so that it groups together all elements dupl.docxModify function partition so that it groups together all elements dupl.docx
Modify function partition so that it groups together all elements dupl.docxlauracallander
 
Michelle Walker- a college junior- normally prides herself on keeping.docx
Michelle Walker- a college junior- normally prides herself on keeping.docxMichelle Walker- a college junior- normally prides herself on keeping.docx
Michelle Walker- a college junior- normally prides herself on keeping.docxlauracallander
 
Mechanisms of Developmental Patterning 1- Explain how cell fate specif.docx
Mechanisms of Developmental Patterning 1- Explain how cell fate specif.docxMechanisms of Developmental Patterning 1- Explain how cell fate specif.docx
Mechanisms of Developmental Patterning 1- Explain how cell fate specif.docxlauracallander
 
Match each of the options above to the items below- The analysis and r.docx
Match each of the options above to the items below- The analysis and r.docxMatch each of the options above to the items below- The analysis and r.docx
Match each of the options above to the items below- The analysis and r.docxlauracallander
 
Match the term with its definition- Drag and drop options on the right.docx
Match the term with its definition- Drag and drop options on the right.docxMatch the term with its definition- Drag and drop options on the right.docx
Match the term with its definition- Drag and drop options on the right.docxlauracallander
 
Match the type of cell to cell signaling with its description- Contact.docx
Match the type of cell to cell signaling with its description- Contact.docxMatch the type of cell to cell signaling with its description- Contact.docx
Match the type of cell to cell signaling with its description- Contact.docxlauracallander
 
Match the soil order to its defining characteristic- Ultisol Oxisol Mo.docx
Match the soil order to its defining characteristic- Ultisol Oxisol Mo.docxMatch the soil order to its defining characteristic- Ultisol Oxisol Mo.docx
Match the soil order to its defining characteristic- Ultisol Oxisol Mo.docxlauracallander
 
Match the horizon with its indicative characteristics- O horizon A hor.docx
Match the horizon with its indicative characteristics- O horizon A hor.docxMatch the horizon with its indicative characteristics- O horizon A hor.docx
Match the horizon with its indicative characteristics- O horizon A hor.docxlauracallander
 
Match the term with its function in the body- Note- Terms may only be.docx
Match the term with its function in the body- Note- Terms may only be.docxMatch the term with its function in the body- Note- Terms may only be.docx
Match the term with its function in the body- Note- Terms may only be.docxlauracallander
 
Match each description to the correct term- Describes how a system wor.docx
Match each description to the correct term- Describes how a system wor.docxMatch each description to the correct term- Describes how a system wor.docx
Match each description to the correct term- Describes how a system wor.docxlauracallander
 
Mikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docx
Mikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docxMikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docx
Mikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docxlauracallander
 
Mike writes a letter detailing how his roommate cheated on his exam- H.docx
Mike writes a letter detailing how his roommate cheated on his exam- H.docxMike writes a letter detailing how his roommate cheated on his exam- H.docx
Mike writes a letter detailing how his roommate cheated on his exam- H.docxlauracallander
 
Michael Jones recorded the following transactions during the month of.docx
Michael Jones recorded the following transactions during the month of.docxMichael Jones recorded the following transactions during the month of.docx
Michael Jones recorded the following transactions during the month of.docxlauracallander
 
microbiology List and explain the five characteristics of the adaptive.docx
microbiology List and explain the five characteristics of the adaptive.docxmicrobiology List and explain the five characteristics of the adaptive.docx
microbiology List and explain the five characteristics of the adaptive.docxlauracallander
 
Nova lab The date ranges for each of the hominins in this puzzle are g.docx
Nova lab The date ranges for each of the hominins in this puzzle are g.docxNova lab The date ranges for each of the hominins in this puzzle are g.docx
Nova lab The date ranges for each of the hominins in this puzzle are g.docxlauracallander
 
Marlin Company has the following projected costs for manufacturing and.docx
Marlin Company has the following projected costs for manufacturing and.docxMarlin Company has the following projected costs for manufacturing and.docx
Marlin Company has the following projected costs for manufacturing and.docxlauracallander
 
Note the Borel sets are countably generated 13-11- 2-9 Show that- if f.docx
Note the Borel sets are countably generated 13-11- 2-9 Show that- if f.docxNote the Borel sets are countably generated 13-11- 2-9 Show that- if f.docx
Note the Borel sets are countably generated 13-11- 2-9 Show that- if f.docxlauracallander
 
Not all experience the COVID-19 pandemic the same way- There are facto.docx
Not all experience the COVID-19 pandemic the same way- There are facto.docxNot all experience the COVID-19 pandemic the same way- There are facto.docx
Not all experience the COVID-19 pandemic the same way- There are facto.docxlauracallander
 

More from lauracallander (20)

Match the cell structure with the cell function- - Plasma Membrane A-.docx
Match the cell structure with the cell function- - Plasma Membrane A-.docxMatch the cell structure with the cell function- - Plasma Membrane A-.docx
Match the cell structure with the cell function- - Plasma Membrane A-.docx
 
Matrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docx
Matrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docxMatrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docx
Matrice -nligs- int -ncols- int -matrice----- int +SELONLIGNES- int +S.docx
 
Modify function partition so that it groups together all elements dupl.docx
Modify function partition so that it groups together all elements dupl.docxModify function partition so that it groups together all elements dupl.docx
Modify function partition so that it groups together all elements dupl.docx
 
Michelle Walker- a college junior- normally prides herself on keeping.docx
Michelle Walker- a college junior- normally prides herself on keeping.docxMichelle Walker- a college junior- normally prides herself on keeping.docx
Michelle Walker- a college junior- normally prides herself on keeping.docx
 
Mechanisms of Developmental Patterning 1- Explain how cell fate specif.docx
Mechanisms of Developmental Patterning 1- Explain how cell fate specif.docxMechanisms of Developmental Patterning 1- Explain how cell fate specif.docx
Mechanisms of Developmental Patterning 1- Explain how cell fate specif.docx
 
Match each of the options above to the items below- The analysis and r.docx
Match each of the options above to the items below- The analysis and r.docxMatch each of the options above to the items below- The analysis and r.docx
Match each of the options above to the items below- The analysis and r.docx
 
Match the term with its definition- Drag and drop options on the right.docx
Match the term with its definition- Drag and drop options on the right.docxMatch the term with its definition- Drag and drop options on the right.docx
Match the term with its definition- Drag and drop options on the right.docx
 
Match the type of cell to cell signaling with its description- Contact.docx
Match the type of cell to cell signaling with its description- Contact.docxMatch the type of cell to cell signaling with its description- Contact.docx
Match the type of cell to cell signaling with its description- Contact.docx
 
Match the soil order to its defining characteristic- Ultisol Oxisol Mo.docx
Match the soil order to its defining characteristic- Ultisol Oxisol Mo.docxMatch the soil order to its defining characteristic- Ultisol Oxisol Mo.docx
Match the soil order to its defining characteristic- Ultisol Oxisol Mo.docx
 
Match the horizon with its indicative characteristics- O horizon A hor.docx
Match the horizon with its indicative characteristics- O horizon A hor.docxMatch the horizon with its indicative characteristics- O horizon A hor.docx
Match the horizon with its indicative characteristics- O horizon A hor.docx
 
Match the term with its function in the body- Note- Terms may only be.docx
Match the term with its function in the body- Note- Terms may only be.docxMatch the term with its function in the body- Note- Terms may only be.docx
Match the term with its function in the body- Note- Terms may only be.docx
 
Match each description to the correct term- Describes how a system wor.docx
Match each description to the correct term- Describes how a system wor.docxMatch each description to the correct term- Describes how a system wor.docx
Match each description to the correct term- Describes how a system wor.docx
 
Mikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docx
Mikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docxMikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docx
Mikhail's Portfolio- Mikhail Khodorkovsky was one of the infamous Russ.docx
 
Mike writes a letter detailing how his roommate cheated on his exam- H.docx
Mike writes a letter detailing how his roommate cheated on his exam- H.docxMike writes a letter detailing how his roommate cheated on his exam- H.docx
Mike writes a letter detailing how his roommate cheated on his exam- H.docx
 
Michael Jones recorded the following transactions during the month of.docx
Michael Jones recorded the following transactions during the month of.docxMichael Jones recorded the following transactions during the month of.docx
Michael Jones recorded the following transactions during the month of.docx
 
microbiology List and explain the five characteristics of the adaptive.docx
microbiology List and explain the five characteristics of the adaptive.docxmicrobiology List and explain the five characteristics of the adaptive.docx
microbiology List and explain the five characteristics of the adaptive.docx
 
Nova lab The date ranges for each of the hominins in this puzzle are g.docx
Nova lab The date ranges for each of the hominins in this puzzle are g.docxNova lab The date ranges for each of the hominins in this puzzle are g.docx
Nova lab The date ranges for each of the hominins in this puzzle are g.docx
 
Marlin Company has the following projected costs for manufacturing and.docx
Marlin Company has the following projected costs for manufacturing and.docxMarlin Company has the following projected costs for manufacturing and.docx
Marlin Company has the following projected costs for manufacturing and.docx
 
Note the Borel sets are countably generated 13-11- 2-9 Show that- if f.docx
Note the Borel sets are countably generated 13-11- 2-9 Show that- if f.docxNote the Borel sets are countably generated 13-11- 2-9 Show that- if f.docx
Note the Borel sets are countably generated 13-11- 2-9 Show that- if f.docx
 
Not all experience the COVID-19 pandemic the same way- There are facto.docx
Not all experience the COVID-19 pandemic the same way- There are facto.docxNot all experience the COVID-19 pandemic the same way- There are facto.docx
Not all experience the COVID-19 pandemic the same way- There are facto.docx
 

Recently uploaded

Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Celine George
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Benefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxBenefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxsbabel
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryCeline George
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...Nguyen Thanh Tu Collection
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/siemaillard
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024CapitolTechU
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45MysoreMuleSoftMeetup
 
Implanted Devices - VP Shunts: EMGuidewire's Radiology Reading Room
Implanted Devices - VP Shunts: EMGuidewire's Radiology Reading RoomImplanted Devices - VP Shunts: EMGuidewire's Radiology Reading Room
Implanted Devices - VP Shunts: EMGuidewire's Radiology Reading RoomSean M. Fox
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatmentsaipooja36
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxNehaChandwani11
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Benefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxBenefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptx
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
Implanted Devices - VP Shunts: EMGuidewire's Radiology Reading Room
Implanted Devices - VP Shunts: EMGuidewire's Radiology Reading RoomImplanted Devices - VP Shunts: EMGuidewire's Radiology Reading Room
Implanted Devices - VP Shunts: EMGuidewire's Radiology Reading Room
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 

All the methods are completed- Write a class named WordCruncherTest th.docx

  • 1. All the methods are completed. Write a class named WordCruncherTest that has only a main method that: The program should continue to do this until the user enters the word "quit" Solution import static java.lang.System.exit; import java.util.Scanner; class WordCruncherTest { public static void main(String args[]) { Scanner m=new Scanner(System.in); String option = ""; option=m.next(); if(option.equals("quit")) { System.out.println("bye"); exit(0); }
  • 2. else { int[] alphabetArray = new int[26];int coun=0; for ( int i = 0; i < option.length(); i++ ) { char ch= option.charAt(i); int value = (int) ch; if (value >= 97 && value <= 122){ alphabetArray[ch-'a']++; coun++; } } for (int i = 0; i < alphabetArray.length; i++) { if(alphabetArray[i]>0){ char ch = (char) (i+97); System.out.println(" occurences : "+ch+" "+alphabetArray[i]+"");Â Â //Show the result. } } System.out.println("number of letters are"+coun); char[] try1= option.toCharArray(); System.out.println("string reverse"); for (int i=try1.length-1;i>=0;i--) System.out.print(try1[i]); System.out.println("");
  • 3. int count=0; for (int i = 0; i < option.length(); i++) { char ch = option.charAt(i); if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') { count++; } } System.out.println("Number of vowels : " + count); } } }