1. (a)
What is Inheritance? Why is it important?
(b)
Write down a simple program that resembles inheritance in java.
2. (a)
Explain different types of inheritance in java with necessary figures. Which of them are used only for class? Name them.
3. (a)
Write down the scenarios where fully qualified name should be used.
(c)
Write down the differences between abstract class and concrete class
4. (a)
Define Interface. Interface contains abstract methods. Then, why dont we write abstract before defining any interface?
(c)
Write down the differences between class and interface.
Students in Computer Science would like to understand the concept of Ohm’s law. You are required to write an application that will allow them to calculate the relation between Voltage, Current and Resistance using the formulas below.
Scenario:
Your friend is developing a maze puzzle game and already designed a module which can generate a random maze. The maze has one entry and one exit point. Now he needs to develop the module which will find the path from entry to exit points for randomly generated maze. Your friend wants the path searching should be quickest. He can use only Stack or Queue data structures to store maze’s visited locations for path generation. He is unable to decide the selection of data structure and asked you to help him.
Question:
From Stack and Queue data structures which data structure you will suggest using for entry to exit path finding module? Select a data structure and give comments in favour to justify your selection. Also mention why you are not selecting the other data structure?
I. Write a comprehensive report on Roslyn Analyzers and FxCop Analyzers. Your report must fulfil the following requirement, [10 marks]
a) Snapshot for the installation of the latest version of Roslyn Analyzers and FxCop Analyzers.
b) List the core features of Roslyn Analyzers.
c) List the core features of FxCop Analyzers.
d) Write a simple CRUD application in C#.
e) Run the Roslyn Analyzers on your application source code to generate the analysis report. Include the snapshot of the result in your report.
f) Fix the violations reported by Roslyn Analyzers. Include the snapshot of the result in your report after fixing all the issues.
g) Run the FxCop Analyzers on your application source code to generate the analysis report. Include the snapshot of the result in your report.
h) Fix the violations reported by FxCop Analyzers. Include the snapshot of the result in your report after fixing all the issues.
i) Write a section in your report to discuss the advantages and disadvantages (if any) of using Roslyn and FxCop Analyzer
Generate a program to proof that the square root of 30 is 900 using NASM Simulator (DOSBox), Briefly explain the steps of your program execution.
a) Write a program that multiply and then add four double precision point values through MIPS.
b.) Write a program to calculate roots of equation using quadratic formula using MIPS simulator.
5x2 -4x-12=0
the expression in the if statement:
if (score =30)
grade='A'
always evaluates to true
Create a program that calculates your daily driving cost, so that you can estimate how much money could be saved by carpooling (car-sharing), which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The program should input the following information and display the user’s cost per day of driving to work:
a) Total miles driven per day.
b) Cost per gallon of gasoline.
c) Average miles per gallon.
d) Parking fees per day.
a) Make a program to find the diameter d=2r and area=4Πr2 or 4 pie r square of the sphere. Value of ‘r’ should be defined by the user.