2018 - Assignment 1 - Fall - PF
2018 - Assignment 1 - Fall - PF
Instructions:
Use proper assignment papers for solving your assignment questions. Assignment done
on diary pages, register pages, rough pages will not be credited.
Do not copy the work of your peers. In case cheating is detected, then your case will be
referred to DC.
Question #1:
Question #2:
You have a secret number system in base 6. The 6 symbols used to represent the numbers 0, 1,
2, 3, 4, 5 are *, @, $, %,?,< respectively.
Question #3:
Question# a: Write pseudo code that reads two numbers and multiplies them
together and print out their product.
Question # b: Write pseudo code that tells a user that the number they entered is
not a 5 or a 6. Question #c: Write pseudo code that performs the following: Ask a
user to enter a number. If the number is between 0 and 10, write the word blue. If
the number is between 10 and 20, write the word red. if the number is between 20
and 30, write the word green. If it is any other number, write that it is not a correct
color option.
Question #d: Write pseudo code to print all multiples of 5 between 1 and 100
(including both 1 and 100).
Question #e: Write pseudo code that will count all the even numbers up to a user
defined stopping point.
Question #f: Write pseudo code that will perform the following. a) Read in 5
separate numbers. b) Calculate the average of the five numbers. c) Find the
smallest (minimum) and largest (maximum) of the five entered numbers. d) Write
out the results found from steps b and c with a message describing what they are.
Question #g: Write pseudo code that reads in three numbers and writes them all
in sorted order. Question #h: Write pseudo code that will calculate a running sum.
A user will enter numbers that will be added to the sum and when a negative
number is encountered, stop adding numbers and write out the final result.
Question #4:
Convert in binary using 2’s complement:
Decimal(signed) 4-bit Binary
-12 ?
-1 ?
-4 ?
-5 ?
-6 ?
-7 ?
-8 ?
8 ?
7 ?
5 ?