0% found this document useful (0 votes)
4 views3 pages

Lab Manual # 1 Programming Fundamentals (Section BSE-1A) : National University of Computer and Emerging Sciences

Uploaded by

Laiba Tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Lab Manual # 1 Programming Fundamentals (Section BSE-1A) : National University of Computer and Emerging Sciences

Uploaded by

Laiba Tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

National University of Computer and Emerging Sciences

Lab Manual # 1
Programming Fundamentals
(Section BSE-1A)

Course Instructor Mr. Raziuddin


Lab Instructor(s) Ms. Shazia Haque
Ms. Sonia Anum
Section BSE-1A
Semester Fall 2021

Department of Computer Science


FAST-NU, Lahore, Pakistan
Objectives
The objectives of this lab are to cover the following:
 What is a bit/byte/ASCII number system
 What is an algorithm?
 How do we write an algorithm in simple english?

Important Notes
 Be aware that you are asked to write algorithms in simple english.
 You will be writing algorithms for sequential statements and conditional statements.
 Try to indent your program so that statements inside a block can be distinguished from
another block

Question#1
Write an algorithm that takes input in two variables number1 and number2. Add these two
numbers and store the result in sum variable. Print the sum.

Example Input:
Input 1: 3
Input 2: 7
Output:
Sum: 10

Question#2
Write an algorithm that takes as input a list of numbers from the user and then a number to
search within it.

Example Input:
List: 12, 17, 3, 44, 77, 2, 1
Number to search: 2
Output: Number 2 exists in the list

Number to search: 21
Output: Number 21 does not exist in the list
Question#3
Write an algorithm that checks whether a list of numbers is sorted in ascending order.

Example Input:
List: 12, 17, 3, 44, 77, 2, 1
Output: List is not sorted in ascending order

List: 12, 17, 44, 77, 91


Output: List is sorted in ascending order.

Question#4
Four defenders in a football match — Defender A, Defender B, Defender C & Defender D —
take their positions in this order in a row from right to left. During the match, Defender A
changes places with Defender C and then Defender C changes places with Defender B.
Which defender is now at the left end of the row? who is to the right of Defender C?
(show your working)

Question#5
UNIVERSITY is coded in a code as UINVRESITY. Find the code for SEQUENTIAL under the
same rule.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy