logo

Crowdly

24-25 CS1821/CS1822/DC1821: Programming Laboratory

Шукаєте відповіді та рішення тестів для 24-25 CS1821/CS1822/DC1821: Programming Laboratory? Перегляньте нашу велику колекцію перевірених відповідей для 24-25 CS1821/CS1822/DC1821: Programming Laboratory в moodle.royalholloway.ac.uk.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

To complete the checkpoint you need to discuss your solution with a

teaching assistant during the checkpoint sessions. Use the box below to

make any notes that will be useful.

Переглянути це питання

To complete the checkpoint you need to discuss your solution with a teaching assistant during the checkpoint sessions. Use the box below to make any notes that will be useful.

Переглянути це питання

Match the following expressions with their values.

Переглянути це питання

Which of the following programs is the shortest that is also equivalent to the following code?

if i % 4 == 0:

x = 0

elif i % 4 == 1:

x = 1

elif i % 4 == 2:

x = 2

else:

x = 3

0%
0%
0%
Переглянути це питання

What values could the expression i % 4 evaluate to?

0%
0%
0%
0%
0%
0%
Переглянути це питання

To complete the checkpoint you need to discuss your solutions with a

teaching assistant during the checkpoint sessions. Use the box below to

record any notes that might be useful.

Переглянути це питання

What is the difference between the two population sizes after 50 years?

Переглянути це питання

The checkpoint sheet is not complete until it has been marked by a TA. During your checkpoint marking meetings, a TA will discuss your work with you and ask some simple questions. If you show a good understanding of the code you have written, they will mark this question (and therefore the sheet) as passed.

You do not need to write anything in the box below, but may use it for notes if you wish.

Переглянути це питання

We can compare the value of two numerical expressions to obtain a boolean value. Comparison operators that you might use include == (checking equality), != (checking for disequality), > (greater than), and < (less than).

What do think the value of the following expressions are?

You can check the answers by extending your program in expressions.py to print out the values of these expressions.

Переглянути це питання

In Python 3, the / operator actually denotes division of floating point numbers, and Python automatically converts integers to floating point when needed. If you want to perform integer division (also called floor division) then you have to use the operator //.

Extend your program in expressions.py to compute and print out the values of the expressions above using // operator instead of /. Is the output what you expected? Floor division gives the largest integer that it smaller than the result of floating point division. Notice that this is not always the same as rounding to the nearest integer!

Enter your answers below

Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.royalholloway.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!