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
Rzqust [24]
4 years ago
11

Create an application (that uses the SortedABList) that allows a user to enter a list of countries that he or she has visited an

d then displays the list in alphabetical order, plus a count of how many countries are on the list. If the user mistakenly enters the same country more than once, the program should inform the user of their error and refrain from inserting the country into the list a second time.
Computers and Technology
1 answer:
gulaghasi [49]4 years ago
8 0

Answer:

import java.util.*;

public class Country

{

  public static void main(String args[])

  {

      char ch,temp;

      int flag = 0;

      String country;

      ArrayList<String> countries = new ArrayList<String>();

      Scanner sc = new Scanner(System.in);

      do

      {

          System.out.println("enter the country you have visited:\t");

          country = sc.next();

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

          {

              if(countries.get(i).equals(country))

              {

                  System.out.println("you have already entered the country");

                  flag = 1;

                  break;      

              }

          }

          if(flag == 0)

          {

              countries.add(country);

              flag = 0;

          }

          System.out.println("want to add another country(y/n):\t");

          ch = sc.next().charAt(0);

      }while(ch!='n');

      Collections.sort(countries);

      System.out.println("Countries you have visited:\t"+countries);

      System.out.println("Total number of contries visited:"+countries.size());

     

  }

}

Explanation:

You might be interested in
In which state of matter is there no particle motion?
kiruha [24]
Solid is your answer for the day
6 0
3 years ago
A researcher is interested in learning more about the different kinds of plants growing in different areas of the state she live
nekit [7.7K]

The answer is

B. Citizen Science

This is because Citizen Science is data collected by normal citizens that collect data as Amateur Scientists.

6 0
3 years ago
Which of the following Office Online apps is most effective for creating multimedia presentations?
DedPeter [7]

Answer:

Powerpoint Online

Explanation:

Powerpoint is used to create presentations.

8 0
3 years ago
Select the type of web page layout described in the following statements.
GREYUIT [131]

Answer:

1) Fixed sidebar layout

2) Fixed sidebar layout

3) Box layout

4) Fixed sidebar layout

5) Featured graphic layout

Explanation:

I got them correct on egd 2021

5 0
3 years ago
Read 2 more answers
What is a typeface?
zepelin [54]

ans . B a collection of similar fonts

8 0
3 years ago
Other questions:
  • The salesperson in a cell phone store is telling me that the phone I'm considering has 8GB of memory, which means I can save 10,
    13·1 answer
  • Why would Google combining information from separate accounts across its services and sites have privacy implications for its us
    11·1 answer
  • In a ________ network, data collisions can occur fairly easily because the network is essentially composed of a single cable.
    5·1 answer
  • A drowsy cat spots a flowerpot that sails first up and then down past an open window. The pot is in view for a total of 0.50 sec
    13·1 answer
  • What is considered to be the core of the Unix operating system ?
    14·1 answer
  • _KOH + _Cu(CIO3)2 - __KCIO3 +<br>_Cu(OH)2​
    12·1 answer
  • The compound known as butylated hydroxytoluene, abbreviated as BHT, contains carbon, hydrogen, and oxygen. A 1.501 g sample of B
    11·1 answer
  • Lucinda is a network manager. She wants to set up a small office computer network so that it will not be affected at all by elec
    12·1 answer
  • Digital _________ Line is a family of point-to-point technologies designed to provide high-speed data transmission over traditio
    14·1 answer
  • Jenny has entered data about models of laptops from company A and company B in a worksheet. She enters model numbers of laptops
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!