Lab 4
Lab 4
Course: CS-111+ Programming Fundamentals (PF) Course Instructor: Dr. Saad Ahmad Khan
Lab: 4th Time: 3 hours Lab Instructor: Mr. Muhammad Aleem
Class: BS (IT + CS) Morning Semester: 1th Total Marks: 40
Name: Roll Number:
Topics:
1. Pseudocode + Algorithms
2. Programming Constructs (Sequence + Selection + Repetition)
3. Arithmetic Operators, Relational Operators, and Logical Operators
4. If structure
5. Loops can be handled only with If structure and GOTO statements.
6. While Loop
7. Flow Charts
Tasks:
Design all the tasks on your registers or notes.
1. Design a flowchart and algorithm to obtain the decimal equivalent of a binary number.
2. Design a flowchart and algorithm to determine the sum of given numbers. Program will take the
input until the user enters 0.
3. Design a flowchart and algorithm to create a pyramid of numbers consisting of a given input
number of lines.
For example, if the given number is 5, then we should see the following:
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
4. Design a flowchart and algorithm to determine the value of an exponential expression of the form
ax, where a, and x are positive numbers.