logo

Crowdly

Browser

Add to Chrome

In24-S1-CS1033 - Programming Fundamentals

Looking for In24-S1-CS1033 - Programming Fundamentals test answers and solutions? Browse our comprehensive collection of verified answers for In24-S1-CS1033 - Programming Fundamentals at online.uom.lk.

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

An integer N is represented in 8-bit two's complement notation as 1111 00112. Which of the following is the correct decimal value of N?

0%
0%
0%
0%
View this question

Suppose you buy a new hard disk and the disk packaging says its capacity is 1 TB. Does this mean the disk has a capacity of 1024 × 230 bytes?

0%
0%
View this question

The IEEE single-precision format for floating-point representation uses 32 bits, which is divided as follows:

 sign → 1 bit, mantissa →23 bits, and exponent → 8 bits. If the decimal number 7.312510  is represented in this format, what will be the correct mantissa? You may omit any trailing zeros in your answer(i.e., no need to write insignificant 0 digits). Also do not need to mention the base of the value(i.e., 1012 could be written as 101).

View this question

The IEEE single-precision format for floating-point representation uses 32 bits, which is divided as follows:    

sign -> 1 bit, mantissa ->23 bits, and exponent -> 8 bits. If the decimal number 31.312510 is represented in this format, what will be the 8-bit exponent? You do not need to mention the base of the value(i.e., 1012 could be written as 101).

View this question

What will be the 8-bit two's complement representation for -12410?

View this question

An integer N is represented in 8-bit two's complement notation as 1001 11002. Which of the following is the correct decimal value of N?

View this question

Can we say that the 8-bit ASCII representation of the digit '7' is 001101112, considering the following interaction with the Python interpreter?

>>> ord('1')
49
>>> ord('8')
56

View this question

Will the 8-bit two's complement representation for -1510 be 111100002?

0%
0%
View this question

What will be the output of the following Python code?

print ((0b1101 & ~1) | (0o033 >> 0x2))

View this question

Exercise L6.E2

Develop a program to read the namebirthday, and gender of a person from a file and output the ten-digit national identity card (NIC) number.  The only input to the program is the name of the file.

  • The first four digits of the ID card are the birth year and the next three digits are the number of days to the birth date from January 1st of that year.

    • eg : Jan 1st - 1, Jan 2nd - 2, ...... , Feb 1st - 32, ......

  • If the person is a female, 500 is added to that value.

  • The next 3 digits are assigned in the order of submission for a particular birth year

The input file contains the records in the order of submission where each attribute is space-separated.

Example:

Contents of the input file  Contents of the expected output file

Saman 1990-05-03 M

Aruni 1990-04-06 F

Kumaran 1988-03-05 M

Nazar 1997-09-24 M

Saman 1990123001

Aruni 1990596002

Kumaran 1988065001

Nazar 1997267001

Please submit the flowchart diagram that illustrates the algorithm of your program here.

View this question

Want instant access to all verified answers on online.uom.lk?

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

Browser

Add to Chrome