> Mini Project Java Hands-On Solutions - TECH UPDATE

Mini Project Java Hands-On Solutions

 Mini Project Java Hands-On Solutions



The main agenda of this solution is those who are unable to do this course due to facing some issues, a little bit of lack of knowledge on these hands-on questions. Try to understand these codes and solve your hands-On Problems. (Not encourage copy and paste these solutions).

The Course Id: -  63716

1. Strings in Java





import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution{
    
    public static int charSearch(String str,char ch){
        //complete the code
        char[] array = str.toCharArray();
        int count = 0;
        for(int i=0;i<str.length();i++){
            if(array[i] == ch){
                count++;
            }
        }
        return count;
    }

public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

String str = reader.readLine();
char ch = (char)reader.read();
System.out.println(charSearch(str,ch));

}
}

2. Arrays in Java





import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {
    public static void main(String args[] ) throws Exception {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */
        Scanner scanner = new Scanner(System.in);
        char[] ch = {'0','1','2','3','4','5','6','7','8','9'};
        int a = scanner.nextInt();
        String str = Integer.toString(a);
        int count = 0;
        for(int i=0;i<ch.length;i++){
            for(int j=0;j<str.length();j++){
                if(str.charAt(j) == ch[i])
                count++;
            }
        if(count>0){
            System.out.println(ch[i]+": "+count);
            count = 0;
        }
        }
        
    }
}

3. Collections in Java:- 




import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {
    public static void main(String args[] ) throws Exception {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */
        Scanner scanner = new Scanner(System.in);
        HashMap<Integer,String> hash = new HashMap<>();
        int n = scanner.nextInt(); 
        scanner.nextLine();
        while(n>0){
            String str =scanner.nextLine();
            String s[] = str.split(" ");
            hash.put(Integer.parseInt(s[0]), s[1]);
            n--;
        }
        int k = scanner.nextInt();
        if(hash.containsKey(k)){
            System.out.println(hash.get(k));
        }
        else{
            System.out.println("-1");
        }
    }
}



Thank You
Mini Project Java Hands-On Solutions Mini Project Java Hands-On Solutions Reviewed by TECH UPDATE on April 26, 2021 Rating: 5

15 comments:

  1. THANNKKKK YOUUUUUUUUUUUUUUUU ........

    ReplyDelete
  2. I need solutions of 62243...can u pls help me

    ReplyDelete
    Replies
    1. Did u get the solutions bro? If yes then please send me also no

      Delete
    2. Hi did you get the answers if yes pls share

      Delete
  3. Can you help me for course id:63717 mini project jdbc,myself. Iam following your telegram group. Thanks in advance.

    ReplyDelete
  4. Could you please help me with the course id: 63717

    ReplyDelete
  5. Thank you.iam following your telegram channel. Could you please help me with 63717 also

    ReplyDelete
  6. Thank you.iam following your telegram page fresco play. Please help me with 63717 course too.thanks in advance

    ReplyDelete
  7. The Second code printing number of digits common is not passing all the test cases

    ReplyDelete
  8. All the handson are not present

    ReplyDelete
  9. Can you please help with 63717 course id.

    ReplyDelete

Powered by Blogger.