Final answer:
To sum the cubes of the first n counting numbers, initialize k to 1 and total to 0, then use a while loop to add the cube of k to the total, incrementing k by 1 each time until k exceeds n, ensuring n remains unaltered.
Step-by-step explanation:
To calculate the sum of the cubes of the first n counting numbers using a while loop without modifying n, you could use the following pseudocode:
k = 1
total = 0
while k ≤ n:
total += k**3
k += 1
This loop starts with k equal to 1 and runs until k exceeds n. Within the loop, the cube of k is added to the total, and k is then incremented by 1. Note that n is not modified throughout this process, which meets the requirements of the assignment.