PROG 1965 CC Programming Concepts II Questions

Final Exam – Programming Concepts II (PROG1965) – August 16, 2023 – 50 marks (Worth 30%)Please read the following instructions carefully before beginning the exam!
1. The Final Exam assignment dropbox on eConestoga is available on Wednesday August 16, 2023 from 14pm, or longer as appropriate if you have an accommodation on file and requested to use it.
1. Submissions will NOT be accepted after that time.
▪ Please do not request more time!
2. Zip and upload your solution periodically, and plan to finish with several minutes to spare.
▪ Only your latest submission will be looked at and marked.
3. This is part 2 of exam. By now you should have completed part 1.
4. The main solution should be named like this: alan_finalexam (if alan is your first name)
5. You need to develop 2 forms here in above solution:
▪ Form1 [contains solution of Q1 to Q5]
▪ Form2 [contains solution of Q6 to Q9]
[By default, Form1 should run. It should have a button with the title “Next4” that opens
the Form2 when clicked]
6. For Q4 and Q5, make a label in the form and answer in that label.
2. And finally, a reminder that all solutions will be run through MOSS, the programming language
plagiarism detector, and all academic integrity violations will be dealt with accordingly!
Overview
You are required to solve each question of this part in the project that is to be submitted in assignment’s folder.
Your code should be fully executable and produce an output (only 1/4 marks if your code is not executing for
any reason).
Questions:
1. (4 marks) Read the description thoroughly, and try writing the code according to the given situation:
Problem: Create an HTML element for the given URL. You can write this createVideo()
function code in the same project, as you will be using this in Q2 to solve that question.
Requirements: Write a function “createVideo( )” with following specifications:
1. it accepts a URL and width as parameters and returns the properly formatted video
element.
For example:
createVideo(‘http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower
_1080p_60fps_normal.mp4’, 500)
should return the following string of HTML:

2. A can also optionally contain a `controls` attribute, which turns on the
play/pause/etc controls.
For example:
In this case, the element should include the user controls. Therefore,your
createVideo() function should also accept a third argument, controls:
// No controls
createVideo(‘http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1
080p_60fps_normal.mp4’, 500)
// With controls
createVideo(‘http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1
080p_60fps_normal.mp4’, 500, true)
2.
3. Formatting: The returned HTML string should be formatted as follows:
– Remove leading/trailing whitespace from src before you use them
– The src and width attribute values should be wrapped in double-quotes (e.g., src=”…”
width=”…”)
– There should be a single space between the end of one attribute and start of the next
(e.g., src=”…” width=”…” controls)
– The width attribute should only be added if a valid integer value (number or string) is
included. Otherwise ignore it.
(4 marks) Use the above createVideo( ) function and do the following:
a. Create a UI that contains enough fields that you can provide user to use your createVideo()
function. Use your imagination and try to create a form that has maximum options provided to
the user to create a video element of their choice.
b. Out of the above controls, you might want to use a “Generate” button that will actually take the
data input by the user and passes it to “createVideo” function and generates a URL and displays
that in a label.
3. (4 marks) You have given this task to your junior developer that they are required to write code of a
class “Book” that has following specifications:
a. Three properties: Title, Author, NoOfPages
b. One constructor to initialize the values
c. Two methods: displayInfo() and borrow()
i. displayInfo() will display all the information of a book
ii. borrow() will show a message that if some book has been borrowed.
d. Write code in the main form to create 2 objects and simulate the behavior of the book class.
4. (4 marks) The junior developer comes up with a solution (from Q3). You just realized that you forgot to
mention it should have 5 properties instead of 3. The junior is quite concerned about incorporating the
modifications into that much code [suppose this code is of thousands of lines
] when you explain this
to them and ask them to update the code to add new fields. If they are uninformed of the scenario and
are unable to develop effective less code to achieve and adapt the new changes, what remedy would
you advise to them?
5. (4 marks) In a big program, debuggers found out that it’s causing a great memory leak. After
investigation, it was found that some parts of the code are producing a huge number of string tails. CEO
is quite concerned about it, and you have been asked to provide a solution to this string trailing and
memory leak that is causing a huge loss to the company’s resources. [As per our discussions in the class,
what do you think might be the problem, and what solution would you propose? – keep in mind, our
whole discussions on this issue during one of the last weeks. A general answer will not be accepted
here]
[For Q6 to 10, you are required to develop an Exam Management System. You will be using interfaces,
inheritance, and other OOP features to get a full working exam management system]
6. (5 marks) To implement inheritance and interfaces first, create an interface IGrades and a base class
Exam with following specifications:
a. IGrades will have only one method declaration GradeExam()
b. Exam class will have two properties (StudentName and ExamScore) and one abstract method
TakeExam().
7. (5 marks) In this part, create a class MultipleChoiceExam with following specifications:
a. It should be the child of Exam class created in Q6.
b. It should implement the IGrades interface.
c. It will have 2 properties TotalQuestions and CorrectAnswers and 2 methods TakeExam() that
overrides the functionality of Exam class and GradeExam() that will just display the message
that student got which grade (based on the calculations may be done in TakeExam() method)
8. (5 marks) In this part, create a class EssayExam with following specifications:
a. It should be the child of Exam class created in Q6.
b. It should implement the IGrades interface.
c. It will have 2 properties TotalPoints and EarnedPoints and 2 methods TakeExam that overrides
the functionality of Exam class and GradeExam() that will just display the message that student
got which grade (based on the calculations may be done in TakeExam() method)
9. (5 marks) Develop a UI that contains appropriate number of form elements to take input from user and
try calling different options. Display respective messages in a label (Try to format your UI as pleasant as
possible). Also implement any actions required to create the objects of above classes and as well as
calling the respective methods.
What to hand in?
As always, zip and upload your solution folder to the Final Exam drop-box for this course. Note – be sure to
include everything in your submission.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER