Assignment 1
Assignment 1
Programming Fundamentals
Fall 2022
Assignment - 1
DUE DATE: 12th September, 2022, 11:59PM
1- Make separate document for each question. Do the same for each question while
creating a flowchart in the Scratch tool.
2- Name the folder as question number (e.g., Q1). Add question (pseudocode) and flow
chart inside that named folder. In the end, place all folders in a single final folder. Name
the final folder as Sec_YourRoll_Assign1. Your final folder should have ten (10) subfolders
in it. (i.e., Q1, Q2, Q3…., Q10)
3- There is no room for plagiarism. In case your assignment finds to be copied from
somewhere, this will lead to severe consequences, even to an ‘F’ grade in the course. Try
to learn by doing assignments yourself.
Questions:
1. Write a pseudo code for the program that takes an input of the sales made by the
salesman for the month and calculates his salary, which is 15% of the total sale.
2. Write pseudo code for the program that calculates the reciprocal of a non-zero integer
entered by the User, stores it, and prints it. Note that Reciprocal is the inverse of a value
or a number. If n is a real number, then its reciprocal will be 1/n. The reciprocal of the
non-zero rational number q/p is p/q.
3. Write a pseudo code of the program that takes input from the user the current date &
user’s date of birth and calculates his age.
4. Write pseudo code of a program that takes two numbers as input from the user, saves
them, and swaps their values without using any third variable. (Hint: Use basic addition
and subtraction operations)
5. Write pseudo code of a program that asks the user his final percentage and assign
him/her a grade according to the following plan.
6. Write a pseudo code of a program that implements the second equation of motion to
compute the distance S. All other parameters are inputs form the user.
S = vit + ½ at2
7. A candidate is to be selected for the admission test based on the following criteria:-
i. The candidate must be under 20 years and did not appear in this test
before.
ii. The candidate must have done FSc Pre-Eng. and scored at least 60%
marks OR he has done an equivalent diploma with at least 70% marks
OR he has done A-level with a minimum of 2 A’s.
If all the above conditions are satisfied, check whether the candidate has registered for
the test and paid the admission test fee; if yes, issue the admission test appearance slip.
You have to write a pseudo code for this process.
8. Write a pseudo code for a program that takes a number in decimal number system as an
input (e.g., 95) and displays its equivalent in binary (e.g., 95 → 01011111 ).
9. Write a pseudo code of a program that inputs a number from the user and checks
whether the number is prime or not.
10. Write a pseudo code of a program that takes an alphabet as input from the user and
checks whether it is a vowel or not, terminate the program if the user enters a vowel.
Use a repetition strategy to implement your logic.
Please note that for each pseudo code, you also need to create a flowchart using scratch tool
and submit both the pseudocode and flowchart as per instructions.