INF2611
2021
Assignment
Assignment 2
number:
Assignment unique
863984
code:
Student number:
Last name &
Initials
Theme Advanced Widgets, Menus, Toolbars
Statement of Compliance
This assignment includes:
• Part A – program source code.
Statement of Originality
This is to certify that to the best of my knowledge; the content of this assignment is my own work.
I certify that the intellectual content of this assignment is the product of my own work and that all
the assistance received in preparing this assignment and sources have been acknowledged.
INF2611 Assignment 2 Template v1.0
, INF2611 Assignment 2
Part A – Single Window Application Source code
You are required to develop a single screen application for the following scenario:
Often it is necessary to calculate how much time (days, hours etc.) will pass before a certain event will take
place. Your app will assist member of the public in calculating how long they will have to wait for their
COVID vaccination. The app must be a simple single screen application that display the current date and
time, inputs the future date, and then displays how much time until the COVID vaccination will take place.
Make use of the following widgets:
• QCalenderWidget (use 2 calendars, one for current date and one for future date)
• QPushButton
• Any display widget for the message showing how much time still to pass
Source code:
Covid.py:
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(380, 645)
self.mainwidget = QtWidgets.QWidget(MainWindow)
self.mainwidget.setObjectName("Mainwidget")
self.calToday = QtWidgets.QCalendarWidget(self.mainwidget)
self.calToday.setGeometry(QtCore.QRect(35, 75, 318, 188))
self.calToday.setGridVisible(False)
self.calToday.setDateEditEnabled(False)
self.calToday.setObjectName("calToday")
self.calVaccination = QtWidgets.QCalendarWidget(self.mainwidget)
self.calVaccination.setGeometry(QtCore.QRect(35, 335, 318, 188))
self.calVaccination.setObjectName("calVaccination")
self.buttonCalculate = QtWidgets.QPushButton(self.mainwidget)
self.buttonCalculate.setGeometry(QtCore.QRect(35, 555, 80, 28))
2
2021
Assignment
Assignment 2
number:
Assignment unique
863984
code:
Student number:
Last name &
Initials
Theme Advanced Widgets, Menus, Toolbars
Statement of Compliance
This assignment includes:
• Part A – program source code.
Statement of Originality
This is to certify that to the best of my knowledge; the content of this assignment is my own work.
I certify that the intellectual content of this assignment is the product of my own work and that all
the assistance received in preparing this assignment and sources have been acknowledged.
INF2611 Assignment 2 Template v1.0
, INF2611 Assignment 2
Part A – Single Window Application Source code
You are required to develop a single screen application for the following scenario:
Often it is necessary to calculate how much time (days, hours etc.) will pass before a certain event will take
place. Your app will assist member of the public in calculating how long they will have to wait for their
COVID vaccination. The app must be a simple single screen application that display the current date and
time, inputs the future date, and then displays how much time until the COVID vaccination will take place.
Make use of the following widgets:
• QCalenderWidget (use 2 calendars, one for current date and one for future date)
• QPushButton
• Any display widget for the message showing how much time still to pass
Source code:
Covid.py:
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(380, 645)
self.mainwidget = QtWidgets.QWidget(MainWindow)
self.mainwidget.setObjectName("Mainwidget")
self.calToday = QtWidgets.QCalendarWidget(self.mainwidget)
self.calToday.setGeometry(QtCore.QRect(35, 75, 318, 188))
self.calToday.setGridVisible(False)
self.calToday.setDateEditEnabled(False)
self.calToday.setObjectName("calToday")
self.calVaccination = QtWidgets.QCalendarWidget(self.mainwidget)
self.calVaccination.setGeometry(QtCore.QRect(35, 335, 318, 188))
self.calVaccination.setObjectName("calVaccination")
self.buttonCalculate = QtWidgets.QPushButton(self.mainwidget)
self.buttonCalculate.setGeometry(QtCore.QRect(35, 555, 80, 28))
2