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
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:
- Software Engineering
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.
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.
Temperature °F = Temperature °C × 9/5 + 32
The Program should display error message and then exit if the user enters any other letter.