Day 17

Day 17

Professional Development

22 Qs

quiz-placeholder

Similar activities

HTML-1

HTML-1

Professional Development

20 Qs

Python - String and Lists

Python - String and Lists

Professional Development

20 Qs

PSC Quiz1

PSC Quiz1

University - Professional Development

20 Qs

CIW IBA Lesson 8 Vocabulary

CIW IBA Lesson 8 Vocabulary

8th Grade - Professional Development

21 Qs

Javascript Fundamental Practice

Javascript Fundamental Practice

Professional Development

20 Qs

Artificial Intelligence

Artificial Intelligence

8th Grade - Professional Development

20 Qs

My SQL- DDL

My SQL- DDL

11th Grade - Professional Development

20 Qs

Minecraft And Fortnite Quiz

Minecraft And Fortnite Quiz

KG - Professional Development

18 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?