1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pavel [41]
4 years ago
5

Dit View

Computers and Technology
2 answers:
exis [7]4 years ago
6 0
1 is the answer to this question
nika2105 [10]4 years ago
4 0

Answer:

1

Explanation:

You might be interested in
Write a Java program that will 1. Ask the user to type in a sentence, using a JOptionPane.showInputDialog(). 2. The program will
Paraphin [41]

Answer:

Here is the JAVA program :

import javax.swing.JOptionPane;   //to use JOptionPane  

public class Main {   //class name

public static void main(String[] args) { //start of main method

   int ECount= 0;   //counts number of upper case E

   int eCount= 0;  //counts number of lower case e

   String sentence;   //stores input sentence string

sentence = JOptionPane.showInputDialog(null, "Type a sentence (type stop to exit)");  //uses showInputDialog method to display a dialog box which prompts user to enter a sentence

 int length = sentence.length();  //stores the length of the sentence

 while (!sentence.equalsIgnoreCase("stop"))  //the loop continues to execute until the user types stop

{ for (int i = 0; i < length; i++) { //loops through the sentence

             if (sentence.charAt(i) == 'E')  //if the character is an uppercase E

                  ECount += 1;  //adds 1 to the count of Ecount

             if (sentence.charAt(i) == 'e')  //if the character in a sentence is lowercase e

                  eCount += 1;}  //adds 1 to the count of lower case e

JOptionPane.showMessageDialog(null, "There are " + ECount + " number of E's and " + eCount + "  number of e's in " +sentence);   //displays the number of times uppercase and lowercase (E and e) occur in sentence

sentence = JOptionPane.showInputDialog(null, "Type a sentence (type stop to exit");  //prompts user to enter the next sentence

length = sentence.length();  //stores the length of sentence at each iteration of while loop until user enters stop

eCount=0;  //resets the counter of lowercase e

ECount=0;  } } } //resets the counter of uppercase e

Explanation:

The program uses showInputDialog() method that displays a dialog box on output screen. This dialog box prompts the user to enter a string (sentence) Suppose user enters "Evergreen" as input sentence so

sentence = "Evergreen"

Next the length of this string is computed using length() method and stored in length variable. So

length = sentence.length();

length = 9

The for loop iterates through this input sentence until the variable i is less than length i.e. 9

At first iteration

if (sentence.charAt(i) == 'E') becomes

if (sentence.charAt(0) == 'E')

Here charAt() method is used which returns the character at the specified index i. This if condition is true because the character at 0-th index (first character) of the sentence Evergreen is E. So ECount += 1; statement adds 1 to the count of upper case E so

ECount = 1

At second iteration:

if (sentence.charAt(1) == 'E')

this condition is false because the character at 1st index of sentence is 'v' which not an upper case E so the program moves to next if condition if (sentence.charAt(i) == 'e') which is also false because the character is not a lower case e either.

At third iteration:

if (sentence.charAt(2) == 'E')

this condition is false because the character at 2nd index of sentence is 'e' which not an upper case E so the program moves to next if condition if (sentence.charAt(i) == 'e') which is true because the character is a lower case e. So the statement eCount += 1; executes which adds 1 to the count of e.

eCount = 1

So at each iteration the sentence is checked for an upper case E and lower case e. After the loop breaks, the program moves to the statement:

JOptionPane.showMessageDialog(null, "There are " + ECount + " number of E's and " + eCount + "  number of e's in " +sentence);

which displays the number of uppercase E and lower case e in a message dialog box. So the output is:

There are 1 number of E's and 3 number of e's in Evergreen.

Then because of while loop user is prompted again to enter a sentence until the user enters "stop". Now the user can enter Stop, StOp, STOp etc. So equalsIgnoreCase method is used to cover all upper/lower case possibilities of the word "stop".

The screenshot of the program and its output is attached.

6 0
4 years ago
Plymouth Colony was originally founded by a group of people called Pilgrims. Since Plymouth did not have an official charter fro
quester [9]

Plymouth Colony was originally founded by a group of people called Pilgrims. Since Plymouth did not have an official charter from England, its government was based on which document? U.S. Constitution Fundamental Orders of Connecticut Articles of Confederation Mayflower Compact.

5 0
3 years ago
I’m select circumstances is a permissible character on the Mac operating system
myrzilka [38]

Answer: /

Explanation: Answer

4 0
3 years ago
Refer to the exhibit. The web servers WS_1 and WS_2 need to be accessed by external and internal users. For security reasons, th
BigorU [14]

Answer:

c.Ports Fa3/1 and Fa3/2 on DSW1 will be defined as secondary VLAN isolated ports. Ports Fa3/34 and Fa3/35 will be defined as primary VLAN promiscuous ports.

Explanation:

Primary VLANs which can only be reached by using promiscuous port, comprises of the gateway and isolated VLANs for users to get out of a network.

The isolated ports can only communicate i.e send and receive data with the promiscuous ports; Fa3/34 and Fa3/35.

Also, WS_1 and WS_2 can neither send nor receive data with the data server, thus we isolate them.

3 0
4 years ago
in a particular factory, a team leader is an hourly paid production worker who leads a small team. in addition to hourly pay, te
malfutka [58]

Facilitate team development for successful project completion. Through coaching and mentoring, provide teammates with technical leadership.

Establishing best practices and habits will help the team maintain high standards for the quality of its software. Identify and promote the team's potential development and improvement areas.

#include<iostream>

using namespace std;

/*C++ Function to print leaders in an array */

void printLeaders(int arr[], int size)

{

  for (int i = 0; i < size; i++)

   {

       int j;

       for (j = i+1; j < size; j++)

       {

           if (arr[i] <=arr[j])

               break;

       }  

       if (j == size) // the loop didn't break

           cout << arr[i] << " ";

 }

}

/* Driver program to test above function */

int main()

{

   int arr[] = {16, 17, 4, 3, 5, 2};

   int n = sizeof(arr)/sizeof(arr[0]);

   printLeaders(arr, n);

   return 0;

}

Learn more about Development here-

brainly.com/question/28011228

#SPJ4

7 0
1 year ago
Other questions:
  • A curb of this color means you may stop only to pick up or drop offs passengers or male
    7·1 answer
  • Google Ads was designed to help businesses achieve online success. To accomplish this, Google Ads was built on three core princi
    13·1 answer
  • Which of the following is the correct financial function that returns the periodic payment for a loan?
    10·1 answer
  • What is polymerization1​
    11·1 answer
  • What is Fill handle?
    12·1 answer
  • Consider a Dog class and a Mammal class. Which is true? Group of answer choices The Dog class is abstract The Mammal class is co
    10·1 answer
  • The math club starts with 5 members. Five months later, their membership has grown to 50 members.
    5·2 answers
  • Select the correct answer from each drop-down menu.
    5·2 answers
  • Visit on social networking site and look for the site's privacy policy.The link is typically found at the bottom of the page and
    9·1 answer
  • Team members can collaborate on ideas using telepresence. <br> true or false?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!