Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It should be similar like this. import javax.swing.JOptionPane; public class Project0 { public static int upperCase = 0; public static int lowerCase = 0; public

image text in transcribed

It should be similar like this.

import javax.swing.JOptionPane;

public class Project0 { public static int upperCase = 0; public static int lowerCase = 0; public static int numberCount = 0; public static void main(String[] args) { // ask type in a sentence String sentence = JOptionPane.showInputDialog("Enter a sentence: (type STOP to quit)");

// executing till the user types "STOP". while (!"STOP".equalsIgnoreCase(sentence) && sentence != null) {

//scan the string and count the number of upper case letters, lower case letters and digits for (char c : sentence.toCharArray()) { if (Character.isUpperCase(c)){ upperCase++; } else if (Character.isLowerCase(c)){ lowerCase++; } else if (Character.isDigit(c)){ numberCount++; } }

Plz write the whole program

Write a Java prog ram that will 1. Ask the user to type in a sentence, using a JOptionPane.showlnputDialog) 2. The program will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter'e' appears. The key here is to use the charAt method in class String 3. Using a JOptionPane.showMessageDialog), tell the user how many upper and lower case e's were in the string Repeat this process until the user types the word "Stop". (Check out the method equalslgnoreCase in class String to cover all upper/lower case possibilities of the word "STOP") 4. Input Message ? Please enter a sentence Number of lower case e's: 4 Every tree is not an Elm, Emilie Number of upper case e's: 3 OK Cancel OK

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago