logo

Crowdly

In24-S1-CS1033 - Programming Fundamentals

Шукаєте відповіді та рішення тестів для In24-S1-CS1033 - Programming Fundamentals? Перегляньте нашу велику колекцію перевірених відповідей для In24-S1-CS1033 - Programming Fundamentals в online.uom.lk.

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

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?

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

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?

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

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).

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

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).

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

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

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

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?

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

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

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

What will be the output of the following Python code?

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

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

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

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

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.

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

Хочете миттєвий доступ до всіх перевірених відповідей на online.uom.lk?

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