Coding
Science
Lit.
Math
Breaking codes
100

How can you reverse a strin?

everything is a bibliography for coding

https://www.softwaretestinghelp.com/

  1. Initiate
  2. The string which is to be reversed is declared.
  3. Get the length of the string.
  4. Start a loop and then swap the position of the array elements.
  5. Keep the exchanged positions.
  6. Print the reversed string.
100

What does LED stand for?

Light emitting diode

100

In the book Silver what is the dog’s name.

Silver

100

1 Times 1

1

100

Gh

Hi

200

How to get the matching characters in a string?

To get the matching characters in a string, the below steps are followed:

  1. Hash Map data structure is taken which works with the key-value pair.
  2. Loop the strings, character by character, and verify if that character of the string exists in the hash map or not.
  3. If the result is true, the counter for the character in the hash map is increased or else then put a count as 1.
  4. Once the loop ends, then the Hash map is traversed and print the characters with more than 1 count.

Code snippet:

HashMap<Character, Integer> mp = new HashMap<> ();

   for (int j = 0; j<text.length (); j++) {

       char ch = text.charAt(j);

          if(mp.containsKey(ch)){

                int cnt = mp.get(ch);

             mp.put(ch, ++cnt);

         }else{

            mp.put(ch, 1);

          }

}

Set<Character> charct = map.keySet();

 

for (Character ch: charct){

     int c= mp.get(ch);

     if(c>1){

        System.out.println(ch+ " - " + c);

     }

200

What measures voltage?

Multimeter

200

Who are the main characters?

Alec and Black

200

5 Times 5

25

200

Hbd

Ice

300

How to calculate the number of vowels and consonants in a string?

To calculate the number of vowels and consonants in a string, the below steps are followed:

  1. Get the string on which count has to be performed.
  2. Run a loop from 0 to the length of the string.
  3. Take a single character at a time and verify if they are a part of the group of vowels.
  4. If the result is true, increase the count of vowels or else increment the count of consonants.

Code snippet:

for (int k = 0; k < text.length(); k++) {

    char c = text.charAt(k);

    if (c == 'a' || c == 'e' || c == 'i' || 

       c == 'o' || c == 'u') 

              owls += vowls

else

            consonts += consonts

}

System.out.println("Vowel count is " + vowls); 

System.out.println("Consonant count is: " + consonts); 

300

How many volts go in a phone?

5V

300

How many men help Alec escape the island ?

5 men

300

12 Times 7

72

300

azad

Babe

400

Find the count for the occurrence of a particular character in a string.

To count the occurrence of a particular character in a string, the below steps are followed:

  1. Start with a string and a particular character whose occurrence shall be counted.
  2. Start a loop from 0 to the length of the string.
  3. Compare if a particular character of the string equals to the character that is being searched.
  4. If the result is true, then increment the value of the counter.

Code snippet:

for (int l=0; l<strng.length(); l++)

{

    if ( strng.charAt(l)== searchedcharacter)

          rslt ++;

 

}

System.out.println(rslt);

400

Who invented the foot pulley?

M.K. T.U. Just kidding!!!

400

Who got trapped in the blizzard? In Big Red

Ross Picket

400

69 Times 40

2760

400

xnt, z q d ,v d k k

You are well

500

How to compute the first character of a string that is not repeated?

To compute the first character of a string which is not repeated, the below steps are followed:

  1. A Set data structure for the repeated characters and a list for the non-repeated character is taken.
  2. After segregating the repeated and non-repeated, at the end of the iteration, the first element of the list is printed in the console.

Code snippet:

Set<Character> repeated = new HashSet<>();

List<Character> nonRepeated = new ArrayList<>();

for (int m = 0; m < wrd.length(); m++) {

            char l = wrd.charAt(m);

            if (repeated.contains(l)) {

                continue;

            }

            if (nonRepeated.contains(l)) {

                nonRepeated.remove((Character) l);

                repeated.add(l);

            } else {

                nonRepeated.add(l);

            }

        }

        return nonRepeated.get(0);

500

If you are born on October 16 what sign of zodiac are you under?

Libra

500

Daily Double!!!

Danny Picket

500

78 times 3

234

500

h  z l  S z m x z

I am Tanya