Day 17

Day 17

Professional Development

•

22 Qs

quiz-placeholder

Similar activities

C

C

Professional Development

•

20 Qs

C-Quest

C-Quest

Professional Development

•

20 Qs

Quiz on C++_1

Quiz on C++_1

Professional Development

•

20 Qs

Lamda kifejezések C# nyelven 1.

Lamda kifejezések C# nyelven 1.

Professional Development

•

17 Qs

CEH V11 MOCK 2

CEH V11 MOCK 2

Professional Development

•

20 Qs

SPARK FIDDLE

SPARK FIDDLE

Professional Development

•

20 Qs

Basics of programming - Quiz - 01

Basics of programming - Quiz - 01

University - Professional Development

•

20 Qs

Introduction to Computing_1

Introduction to Computing_1

4th Grade - Professional Development

•

17 Qs

Day 17

Day 17

Assessment

Quiz

•

Computers

•

Professional Development

•

Practice Problem

•

Easy

Created by

Venkatesh iGen

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        String s = "abc";

        int sum = 0;

        for (char c : s.toCharArray()) {

            sum += c;

        }

        System.out.println(sum);

    }

}

294

297

300

303

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        String s = "a1b2c3";

        int sum = 0;

        for (int i = 1; i < s.length(); i += 2) {

            sum += s.charAt(i) - '0';

        }

        System.out.println(sum);

    }

}

6

3

5

4

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        int[] arr = {513, 46, 29};

        int max = 0;

        for (int num : arr) {

            while (num > 0) {

                max = Math.max(max, num % 10);

                num /= 10;

            }

        }

        System.out.println(max);

    }

}

6

5

9

3

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        String s = "6589";

        char[] arr = s.toCharArray();

        char temp = arr[0];

        arr[0] = arr[arr.length - 1];

        arr[arr.length - 1] = temp;

        System.out.println(new String(arr));

    }

}

6589

9586

9865

9568

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        int[] a = {10, 20, 30};

        int sum = 0;

        for (int i = 1; i < a.length; i++) {

            sum += a[i] - a[i - 1];

        }

        System.out.println(sum);

    }

}

20

10

30

40

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        String[] s = {"abc", "de", "fghi"};

        int count = 0;

        for (String str : s) {

            count += str.length();

        }

        System.out.println(count);

    }

}

4

8

5

9

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Main {

    public static void main(String[] args) {

        int n = 237541;

        int count = 0;

        while (n > 0) {

            int d = n % 10;

            if (d == 2 || d == 3 || d == 5 || d == 7) count++;

            n /= 10;

        }

        System.out.println(count);

    }

}

6
5
4
3

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?