You are on page 1of 8

CS 101 Introduction to Programming Programming Assignment - # 1

Instructors: Mukhammadali Khayotov, Khumoyun Aminaddinov, Bekzod Mukhamedov


Term: Spring 2024

Student ID: Student Name:

Topic: Number systems: Binary, Octal, Decimal and Hexadecimal

Due Date: 13 March 2024, 23:59

Instructions:
- You must submit handwritten solutions for this assignment on A4 sheets.
- You must write your ID and Full Name on all homework papers.
- You are required to follow the order of problems strictly. Answers out of order would not
be marked.
- You are required to show every step of your solution in detail. Simple answers without
solutions would result in zero marks.
- You can solve problems using any method explained during lecture and tutorial classes.
- You are required to submit an assignment before the deadline. Late submission would
result in zero marks.
- You can use tablets to edit PDF file then you can submit PDF file
- Follow instruction how to upload your homework using mobile on the Gradescope:

Hints: How to convert from any base to any base


1. Convert from source base to decimal (base 10 ) by multiplying each digit with the base raised
to the power of the digit number (starting from right digit number 0):
X
[decimal = (digit ∗ basedigitnumber )]

2. Convert from decimal to destination base: divide the decimal with the base until the quotient
is 0 and calculate the remainder each time. The destination base digits are the calculated
remainders.

1
Student ID: Student Name:

Problem 1
Convert the following binary values to hex:

a) 100011112 c) 011110112 e) 10000102


b) 10110012 d) 11100102 f) 110010102

2
Student ID: Student Name:

Problem 2
Convert the following hex values to binary:

a) AA16 c) CB16 e) DAD16


b) 1416 d) F F16 f) BEE16

3
Student ID: Student Name:

Problem 3
Convert the following octal values to binary:

a) 1238 c) 7778 e) 468


b) 668 d) 238 f) 1118

4
Student ID: Student Name:

Problem 4
Convert the following decimal values to the corresponding base:

a) 102410 =?2 c) 71010 =?8 e) 644810 =?16


b) 13410 =?2 d) 11110 =?8 f) 8441110 =?16

5
Student ID: Student Name:

Problem 5
Convert the following values:

a) 98C16 =?8 d) 758 =?16


b) 4C016 =?8 e) 6348 =?16
c) 1F B616 =?8 f) 2738 =?16

6
Student ID: Student Name:

Problem 6
Solve the expressions in binary representation:

a) 1310 +1310 =?2 c) 18710 -12610 =?2


b) 11011112 +111012 =?2 d) 11001112 -1011012 =?2

7
Student ID: Student Name:

Problem 7
Name version control systems that you know and their differences?

Problem 8
What is difference between syntax and semantics ? Describe with your own words.

Problem 9
Describe the main difference between C and C++.

Problem 10
Name IDEs for C/C++ that you know.

You might also like