Professional Documents
Culture Documents
Barani Institute of Management Sciences: Mid-Term Exam Spring 2019
Barani Institute of Management Sciences: Mid-Term Exam Spring 2019
Barani Institute of Management Sciences: Mid-Term Exam Spring 2019
NOTE:-
Write to-the-point and precise answers to the questions with code examples.
You are not allowed to ask any explanation about the question paper from anybody during the exam.
Q1: Differentiate between virtual and abstract members with code example. [6]
Q2: Differentiate between out and ref. with code example. [6]
Q3: Write the C# code for the converting Fahrenheit to Celsius conversion for temperature.
Formula = C = 5/9 (° F – 32)
[6]
txtFarenheit TextBox
txtCelcius TextBox
btnConvert Button
lblFarehneit Label
Q4: Write a C# method double HarmonicMean(double a, double b) that would return the
harmonic mean between the two parameters a and b. Don’t write the entire program, just
write the function, assuming n has already been initialized. The formula for calculating
𝟐𝒂𝒃
harmonic mean is: 𝑯𝑴 = [6]
𝒂 𝒃
(Best of Luck)