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

Course Code: Csl-113 Course Title: Computer Programming Lab Assignment 1

This document outlines an assignment for a Computer Programming Lab course. It includes 8 questions to write programs that perform various tasks using loops and conditionals. The programs are to display formatted text, perform calculations based on input values, and generate patterns and tables. Students are instructed to submit hard copies of their individual assignments by the specified deadlines, and that late or plagiarized submissions will be penalized.

Uploaded by

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

Course Code: Csl-113 Course Title: Computer Programming Lab Assignment 1

This document outlines an assignment for a Computer Programming Lab course. It includes 8 questions to write programs that perform various tasks using loops and conditionals. The programs are to display formatted text, perform calculations based on input values, and generate patterns and tables. Students are instructed to submit hard copies of their individual assignments by the specified deadlines, and that late or plagiarized submissions will be penalized.

Uploaded by

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

COURSE CODE: CSL-113

COURSE TITLE: COMPUTER


PROGRAMMING Lab

ASSIGNMENT 1

Q1: Write a program to display the following format using while loop

----------------------------------
A B
----------------------------------
1 5
2 4
3 3
4 2
5 1
Q2: Write a program to display the following format using while loop

----------------------------------
A B
----------------------------------
1 1
2 3
3 6
4 10
5 15
Q3: Write a program to display the following format using loop

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

Q4: Write a program that inputs the salary of an employee from the user. It deducts the income tax
from the salary on the following basis
1) 20% income tax if the salary is above Rs. 30000.

Computer Programming Lab Assignment Page 1


2) 15% income tax if the salary if the salary is between Rs. 20000 and 30000.
3) 10% income tax if the salary is below Rs. 20000.
The program finally displays the salary, income tax and the net salary.

Q5: Write a program that display the following menu for parking area

M =Motorcycle
C =Car
B =Bus

The program inputs the type of vehicle and number of days to park the vehicle. It finally displays the
total charges for the parking according to the following:

Motorcycle Rs. 10 per day


Car Rs. 20 per day
Bus Rs. 30 per day

Q6: Write a program that inputs a value and type of conversion. The program should then display the
output after conversion. The program should include the following conversions:

1) 1cm = .394 inches


2) 1 Liter = .264 gallons
3) 1 kilometer = .622 miles
4) 1 kilogram = 2.2 pounds
Make sure that the program accepts only valid choices for the type of conversion.

Q7: Write a program using nested for loop to display multiplication table as follows

1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

Q8: write a program that generates the following checker card by using loop.

-----------------
----------------
-----------------
----------------
-----------------
----------------

Submission Details:
 This is an Individual assignment.

Computer Programming Lab Assignment Page 2


 Hard copy of the assignment should be submitted on the date mentioned in the table.

Class Name Deadlines


BS(IT) 1A 23rd October
BS(IT) 1B 23rd October
 Any submission after the deadline will have a 10% marks deduction for each extra day.
 Plagiarism will be awarded zero marks.
 I will take viva on the day of submission.

Computer Programming Lab Assignment Page 3

You might also like