Lab # 2 SSUET/QR/114
LAB # 2
Good practices of programming
OBJECTIVE
Implementing good code practices and code optimization techniques.
Lab Task:
1. Create a design for the mark sheet by taking runtime value of student name, total marks,
obtained marks and calculate its percentage, grade and GPA. Use good practices of
programming that we have studied and ensure that the outcomes should be presented in a
proper Viewable approach.
SWE-312 Software Construction and Development
Lab # 2 SSUET/QR/114
2. Create a class Rectangle with attributes length and width, each of which defaults to 1. Provide
methods that calculate the rectangle’s perimeter and area. It has set and get methods for both
length and width. The set methods should verify that length and width are each floating-point
numbers larger than 0.0 and less than 20.0. Write a program to test class Rectangle.
SWE-312 Software Construction and Development