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:
Answer:
Optical system. An overhead projector works on the same principle as a slide projector, in which a focusing lens projects light from an illuminated slide onto a projection screen where a real image is formed.
Explanation:
You should structure the text first before you search for a relevant picture
Group of answer choices.
A. Spreadsheet program
B. Microsoft Windows Explorer
C. Word-processing program
D. Notepad
Answer:
B. Microsoft Windows Explorer
Explanation:
A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.
In this scenario, you saved a file on drive "C" of your computer. The software program or application which you would use to find and open the file is Microsoft Windows Explorer.
The Microsoft Windows Explorer is an inbuilt resources that avails the end users the ability to perform various operations on a file and it provides the folder paths used for the storage of user files. It is the default program for file and folder documents on a computer system.
Answer:
<em>C++</em>
////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
int n = 1;
while (n != 0) {
cout<<"Enter an integer, the input ends if it is 0: ";
cin>>n;
v.push_back(n);
}
cout<<endl;
///////////////////////////////////////////////////////////
int sum = 0;
int num_positives = 0, num_negatives = 0;
for (int i=0; i<v.size()-1; i++) {
if (v[i] > 0)
++num_positives;
else
++num_negatives;
sum = sum + v[i];
}
//////////////////////////////////////////////////////////
cout<<"The number of positives is "<<num_positives<<endl;
cout<<"The number of negatives is "<<num_negatives<<endl;
cout<<"The total is "<<sum<<endl;
cout<<"The average is "<<(float)sum/(v.size()-1);
///////////////////////////////////////////////////////////
return 0;
}