Sessional 2 Question paper
COMSATS University Islamabad, Vehari Campus
Department of Computer Science
Class: BSCS Date: 03 May 2021
Subject: Introduction to ICT Lab Instructor: Yasmeen Jana
Max Marks: 15 Time Allowed: 60 minutes
Program 1:
Write a program that allows the user to input his favorite courses. If a course is offered by university, that course is added to a new list. If it’s not, a message is printed, apologizing for being not offering the course. The output look like this:
The courses offered by university are:
- C++
- Python
- Software Engineering
- Java
Program 2:
Write a Program that gets the number and a letter.
If the letter is ‘f’, the program should treat the number entered as temperature in degrees Fahrenheit and convert it to the temperature in degree Celsius and print a suitable message.
Formula:
Temperature °C= (Temperature °F − 32) × 5/9
If the letter is ‘c’, the program should consider the number as Celsius temperature and convert it to Fahrenheit temperature and print a suitable message.
Formula:
Temperature °F = Temperature °C × 9/5 + 32
The Program should display error message and then exit if the user enters any other letter.
1 thought on “Sessional 2 Question paper”
Leave a Reply
You must be logged in to post a comment.
Good website for us.Every lecture is giving in detai