Skip to main content

Advanced Topics MCQ

Code Tracing: Computing and Society

All AT CS Tests

Code Tracing: Computing and Society

Question 1 of 25

Answered 0 of 25

Choose one answer.

What is printed after the consent checks?

public class ConsentFilter
{
    public static void main(String[] args)
    {
        boolean[] consent = {true, false, true, true, false, true};
        int[] minutes = {15, 40, 22, 35, 18, 27};
        int used = 0, total = 0;
        for (int i = 0; i < minutes.length; i++)
        {
            if (consent[i] && minutes[i] >= 20)
            {
                used++;
                total += minutes[i];
            }
        }
        System.out.println(used + ":" + total);
    }
}
Choose one answer.