0% found this document useful (0 votes)
4 views2 pages

Good Programming Practices Lab Guide

The document outlines Lab #2 for a software construction course, focusing on good programming practices and code optimization. It includes tasks to create a mark sheet that calculates percentage, grade, and GPA based on user input, as well as a Rectangle class with methods for calculating perimeter and area, including validation for dimensions. The lab emphasizes implementing proper coding techniques and presenting outcomes effectively.

Uploaded by

Wasay Faisal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Good Programming Practices Lab Guide

The document outlines Lab #2 for a software construction course, focusing on good programming practices and code optimization. It includes tasks to create a mark sheet that calculates percentage, grade, and GPA based on user input, as well as a Rectangle class with methods for calculating perimeter and area, including validation for dimensions. The lab emphasizes implementing proper coding techniques and presenting outcomes effectively.

Uploaded by

Wasay Faisal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like