Answer:
total = 0
k = 1
while k <= 50:
total += k**2
k += 1
print(total)
Explanation:
Note: There some errors in the question. The correct complete question is therefore provided before answering the question as follows:
Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and associates that value with total. Thus your code should associate 1*1 + 2*2 + 3*3 +... + 49*49 + 50*50 with total. Use no variables other than k and total.
The answer is now explained as follows:
# Initialize k which is the number of term
k = 1
# Initialize total which is the sum of squares
total = 0
# Loop as long as k is less than or equal to 50.
while (k <= 50):
# Add the square of k to total in order to increase it
total = total + k * k
# Increase the value of k by one.
k += 1
# Finally, output total
print (total)
Answer:
1. siblings + 1
2. numberOfPizzas * pizzaCost
3. alienGreeting + alienGreeting2
4. color1 === color2
5. value1 - value2
6. console.log(gradeAverage === gradeAverage2)
7. numberToString + numberToString2
8. numberOfStudents / numberOfClassrooms
9. console.log(carSpeed === truckSpeed)
Answer:
B. Machine dependent and machine oriented pls mark me branilest
Answer:
javac Welcome.java
Explanation:
In order to the file to compile with the default compiler in the JDK, the instruction must be of the form:
javac filename
(Note: the filename with the .java extension)