SlideShare una empresa de Scribd logo
1 de 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);
}
}
}

Más contenido relacionado

Similar a 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 a 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
 

Más de 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
 

Más de 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
 

Último

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Último (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

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); } } }