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]
3 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]3 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
The family size bottle of sunscreen holds 121212 fluid ounces (\text{fl oz})(fl oz)(, start text, f, l, space, o, z, end text, )
dolphi86 [110]

Answer:

The regular bottle holds 9 fluid ounces less than the family size bottle.

Explanation:

The family size bottle of sunscreen holds 12 fluid ounces

The regular bottle holds 75 percent less

75 percent of 12 = (75/100) X 12 =0.75 X 12 =9

Since the regular bottle holds 75% less, it holds 9 fluid ounces fewer fluid than the family size bottle of sunscreen.

NOTE: The regular size holds three(3) fluid ounces of sunscreen.

6 0
3 years ago
Ann wants to save her presentation so she can work on it later. Which device on her computer can store this data long term?
RUDIKE [14]
I would say that the best option would be a multimedia card.
4 0
2 years ago
Structured walk-throughs take place throughout the SDLC and are called _____ reviews, depending on the phase in which they occur
Tpy6a [65]

Answer:

design

Explanation:

Based on the information provided within the question it can be said that these are called design reviews. This is one of the most important parts of the development of a system. This focuses more on answering how something is going to be done in the system as opposed to answering what is going to be done for the system depending on the questions asked in the analysis phase.

5 0
2 years ago
How works GPS on boats?
zaharov [31]
If you mean sonar it uses echolocation but GPS is signaled from satellite to the internal antenna
8 0
3 years ago
Camera lenses typically have very long focal points. true or false.
Alisiya [41]
No, it is false. This is mainly because there would be no need.
8 0
2 years ago
Read 2 more answers
Other questions:
  • What is the formula equivalent to the function =SUM(B1:B5)?
    11·2 answers
  • Which is the most efficient way to italicize a row of text in every worksheet in a workbook?
    8·1 answer
  • A ____ operating system should be capable of supporting the applications and tools necessary to support Internet operations.
    10·1 answer
  • Why is brainly not working it say im logged out rn but im not i cant acces anything but this
    12·2 answers
  • Self contained sequences of actions to be performed are?
    6·1 answer
  • The Mail Merge option is located in which tab? a;home b;insert c;refernces d;mailings
    11·2 answers
  • What should be done with statements or sections which are unclear?
    12·2 answers
  • Hypercompetition implies that any architecture must be designed with maximum flexibility and _____ to ensure it can handle the i
    6·1 answer
  • write the definition of a class clock. the class has no constructors and one instance variable of type int called hours.
    12·1 answer
  • A text that presents an event and describe what happens as a result is an example of what text structure
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!