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
alina1380 [7]
3 years ago
15

Java:

Computers and Technology
1 answer:
Agata [3.3K]3 years ago
5 0

Answer:

import java.util.*;

public class work {

// function for counting unique character

public static int numUnique(String input) {

boolean[] list = new boolean[Character.MAX_VALUE];

for (int i = 0; i < input.length(); i++) {

list[input.charAt(i)] = true;

}

int count = 0;

for (int i = 0; i <list.length; i++) {

if (list[i] == true){

count++;

}

}

return count;

}

public static void main(String args[])

{

List<String>list=new ArrayList<>(); // creatng array list of type string

list.add("abcdef");

list.add("aaabcd");

list.add("bccddee");

list.add("abcddd");

list.add("a");

for(String str:list)

{

// for printing the results

System.out.println("given string : "+ str+" , number of unique values :"+numUnique(str));

}

}

}

Explanation:

You might be interested in
Which option ensures that different parts of the document can have different page layouts? ​
Mice21 [21]

Answer:

77777777777777777

Explanation:

8 0
3 years ago
Read 2 more answers
Which of these are correctly formatted Python dictionaries? Check all that apply. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’
Advocard [28]

Answer:

A. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}

Explanation:

Since <em>python does not use type when declaring a variable</em>, you must make sure you make your variables correctly or else it won't compile correctly. Lists use braces[]; Strings use quotes, "" or ''; Integers are just declared with a number(s); Dictionaries use brackets{} and inside are <u>attributes of something</u>. For instance, you can use dictionaries to describe ages, {'"Bryan": 6, "Alex": 13, etc.} <u>Sort of like a json file</u>. Dictionaries also tend to use <u>uppercase letters</u> when describing something. The only answer that has all the attributes correct is A. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}

hope i helped :D

7 0
3 years ago
Read 2 more answers
EXERCISE
nirvana33 [79]

Answer:

1. True

2. True

3. False

4. True

5. True

8 0
2 years ago
Which of the following describes the test phase of the program process
wlad13 [49]

Program testing is an evaluative process which is also called Unit Testing by the programmers.

Explanation:

Software testing is an important step in the software development process. The procedure analyzes the functionality of it and if it meets the specified requirements or not. This is a four-stage procedure that involves analysis, planning, development, setting the test environment, and finally the execution of the test.

The main stages of testing that will result in an error-free and quality product are-  

  1. Unit testing
  2. Integration testing
  3. System testing
  4. Acceptance testing

3 0
3 years ago
To view the contents of a file that was compressed with the bzip2 utility, you must used the ____________________ command.
bekas [8.4K]

Answer:

zcat

Explanation:

Zcat is a command line utility for viewing the contents of a compressed file without literally uncompressing it. It expands a compressed file to standard output allowing you to have a look at its contents. In addition, zcat is identical to running gunzip -c command.

8 0
3 years ago
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • System software falls into two categories: operating system software and ____ programs.â
    13·1 answer
  • 3. Describe what a pre-processor does in a network-based IDS tool such as Snort. Demonstrate your understanding of this function
    6·1 answer
  • Which of the following terms describes a type of useful and legitimate software that is distributed by a developer where they do
    10·1 answer
  • Coordinate with
    12·1 answer
  • What is the viewport?
    5·1 answer
  • I need help solving this problem on Picoctf. The question is What happens if you have a small exponent? There is a twist though,
    7·1 answer
  • Suppose you are working in a computer lab during the work you are facing window failure or other technical issues.How you will s
    12·1 answer
  • Simple Java programming
    15·2 answers
  • which two partitions do you typically create at minimum during a fedora linux installation? (choose two answers.)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!