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
True or false: Information security primarily relies on technical approaches such as multifactor authentication or data encrypti
Brilliant_brown [7]

TRUE, that is a one-sided answer. One of the biggest examples is virtually unhackable blockchains.

8 0
3 years ago
Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add an instance variable, named depart
sweet [91]

Answer:

see explaination

Explanation:

class Employee

{

String name;

double salary;

void tostring()

{

System.out.println("Employee:\nName: "+name+"\nSalary: "+salary+"\n");

}

Employee(String n,double s)

{

name=n;

salary=s;

}

}

class Manager extends Employee

{

String department;

void tostring()

{

System.out.println("Manager:\nName: "+name+"\nDepartment: "+department+"\nSalary: "+salary+"\n");

}

Manager(String n,double s,String d)

{

super(n,s);

department=d;

}

}

class Executive extends Manager

{

void tostring()

{

System.out.println("Executive:\nName: "+name+"\nDepartment: "+department+"\nSalary: "+salary+"\n");

}

Executive(String n,double s,String d)

{

super(n,s,d);

}

}

public class test

{

public static void main(String args[])

{

Employee e =new Employee("Neo",12000);

e.tostring();

Manager m =new Manager("Cramster",100000,"Homework");

m.tostring();

Executive ex =new Executive("Chuks",1000000,"Homework");

ex.tostring();

}

}

8 0
3 years ago
A user logs on to a laptop and opens her email. What device will provide emails to the laptop?
Pavel [41]

Answer:

a. Router

Explanation:

The device that provides emails to the laptop would be the Router. This device is basically the intermediary between your personal computer and the vast internet. It basically decides what information is safe enough to allow into your computer, as well as what the fastest path for the data to travel is. When emails are sent to your address the router allows you to access that information by connecting you to the correct pathways through the internet so that you can view those emails.

5 0
3 years ago
A ____ is a set of software tools used by an attacker to hide the actions or presence of other types of malicious software, such
finlep [7]

Answer:

A <u>rootkit</u> is a set of software tools used by an attacker to hide the actions or presence of other types of malicious software, such as trojans, viruses, or worms.

Explanation:

A <u>rootkit</u> is a set of software tools used by an attacker to hide the actions or presence of other types of malicious software, such as trojans, viruses, or worms. Where a Rootkit provides features like remote access to users, it also opens ways for attackers. It helps in hiding the malicious software. Rootkits can be installed on the victim systems by phishing attack or social engineering techniques ..

6 0
3 years ago
Which of the following is NOT true about high-level programming<br> languages?
aniked [119]

Answer:

this can't be answered because you didn't show the "following" answers

8 0
3 years ago
Read 2 more answers
Other questions:
  • Consider that a large online company that provides a widely used search engine, social network, and/or news service is consideri
    12·1 answer
  • Enlist the various data analysis methods for study of Infrasonic waves, Seismic waves, Earthquake prone areas and how AI can be
    15·1 answer
  • A money ____ refers to moving a cash amount from one account to another.
    7·2 answers
  • PLZZZ HELP 30 POINTS!!
    14·1 answer
  • An IT technician has manually configured an IP address on a laptop for a new employee. Each time the employee tries to connect t
    10·1 answer
  • Why did latex replace wax?
    7·1 answer
  • What is application software used for
    13·1 answer
  • You are configuring two PCs for your network, PC-A is given an IP address of 192.168.1.18 and PC-B is given an IP address of 192
    15·1 answer
  • I need answer poooo<br>​
    10·1 answer
  • Why is computer economics important?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!