logo

Crowdly

Browser

Add to Chrome

Rekenaarwetenskap - Computer science - 113/114

Looking for Rekenaarwetenskap - Computer science - 113/114 test answers and solutions? Browse our comprehensive collection of verified answers for Rekenaarwetenskap - Computer science - 113/114 at stemlearn.sun.ac.za.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Download the plagiarism form, read it, and sign it.

Upload the signed plagiarism form as pdf.

Plagiarism Declaration Form: LINK

View this question

What does the Python3 program below compute?

Wat bereken die Python3 program hieronder?

#--------------------------------

#newton.py

import stdio

import sys

def main():

    c = float(sys.argv[1])

    t = c

    EPSILON = 1e-15

    while (abs(t - c*t**(-4)) > EPSILON*t):

        t = 0.8*t + 0.2*c*t**(-4)

    stdio.writeln(t)

if __name__ == "__main__": main()

#--------------------------------

 
View this question

What is printed to the screen if the following command is executed?

Wat word na die skerm gedruk as die volgende bevel uitgevoer word?

python3 isleapyear.py 1852

#--------------------------------

#isleapyear.py

import stdio

import sys

def main():

year_in = int(sys.argv[1])

year = 0

while(year_in>0):

year *= 10

year += year_in%10

year_in //= 10

isLeapYear = (year % 4 == 0)

isLeapYear = isLeapYear and ((year % 100) != 0)

isLeapYear = isLeapYear or ((year % 400) == 0)

    stdio.writeln(isLeapYear)

if __name__ == "__main__": main()

#--------------------------------

View this question

Choose form the given options below the option which gives the correct binary representation of the decimal number 942.

Kies die opsie hieronder wat die korrekte binêre voorstelling van die desimale getal 942 weergee.

View this question

What is printed to the screen if the following Python3 program is executed?

Wat word na die skerm gedruk as die volgende Python3 program uitgevoer word?

#--------------------------------

#ruler.py

import stdio

def main():

  x = 1234

  ruler = ""

  for k in range(4):

    digit = str(x%10)

    x //= 10

    ruler = ruler + digit + ruler

  stdio.writeln(ruler)

if __name__ == "__main__": main()

#--------------------------------

 
View this question

What does the following Python program print to the screen when executed?

Wat druk die volgende Python program na die skerm wanneer dit uitgevoer word?

#--------------------------------

#precedence.py

import stdio

def main():

   X = 2

   Y = 1

    

    X = X**Y**X + 5*Y

    Y = (5*Y % 4) // 2

    stdio.writeln(str(X)+" "+str(Y))

if __name__ == "__main__": main()

#--------------------------------
View this question

Who is regarded as being the first programmer?

Wie word beskou as die eerste programmeerder?

View this question

What does the following Python program print to the screen when executed?

Wat druk die volgende Python program na die skerm wanneer dit uitgevoer word?

#--------------------------------

#boole1.py

import sys

import stdio

def main():

   x = False

    y = True

   x = (x and y) or not(x or y and x) and y or not y

   y = (x and y) or (x or y); y = not (x and y) and (x or y)

    stdio.write(str(x))

    stdio.write(" "+str(y))

    stdio.writeln(" "+str(x ^ y))

if __name__ == "__main__": main()

#--------------------------------
View this question

Simplify:

Vereenvoudig:

not ((not (a and b or c) and (a or b and c)) or ((a and b or c) or not (a or b and c))) 

View this question

What is the value of j after each of the following code fragments is executed?

Wat is die waarde van j nadat elkeen van die volgende kode fragmente uitgevoer is?

View this question

Want instant access to all verified answers on stemlearn.sun.ac.za?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome