Skip to content

ISC · Computer Science

Question 2

1 mark

CISCE ISC 2025 specimen paper · Computer Science · Q2

Short answer

The following is a function of class Armstrong. This recursive function calculates
and returns the sum of the cubes of all the digits of num, where num is an integer
data member of the class Armstrong.
[A number is said to be Armstrong if the sum of the cubes of all its digits is equal
to the original number].
There are some places in the code marked by ?1?, ?2?,?3? which may be replaced
by a statement/expression so, that the function works properly.
public int sumOfPowers(int num)
{
if (num == 0)
return ?1?;
int digit = ?2?;
return (int) Math.pow(digit, 3) + ?3?;
}

  1. (a)

    What is the expression or statement at ?1?

  2. (b)

    What is the expression or statement at ?2?

  3. (c)

    What is the expression or statement at ?3?
    ----------------------------------------------------------------------------------------------------------------------------------
    PART II– 50 MARKS
    Answer six questions in this part, choosing two questions from
    SECTION - A
    Answer any two questions.

No answer recorded yet

When an answer is added, this page says what stands behind it: CISCE’s marking scheme, a teacher’s review, a machine check, or that it is an unreviewed draft.

Browse questions with answers

Board explanation

Explanation unavailable for this question

This question has no answer yet, so the teacher has nothing to check an explanation against.

Browse questions with answers

AI Examiner

Not available for this question

No checked answer or marking scheme for this question yet.

It has no answer yet, so there is nothing to mark against. The AI Examiner marks only questions that have an official marking scheme or an answer a teacher has reviewed.

Browse questions with answers

More from this chapter

From the same topic and chapter, at a similar level.