Professional Documents
Culture Documents
Software Enggnering Lab File
Software Enggnering Lab File
Software Enggnering Lab File
LAB FILE
ICT-260
Submitted in partial fulfilment of the requirements for the award of the degree of
B.Tech.
in
Computer Science Engineering
1) WAP to calculate lines of code of a given program from the text file
Code :
#include <iostream>
#include <fstream>
#include <string>
int lineCount = 0;
string line;
while (getline(file, line)) {
if (!line.empty()) {
lineCount++;
}
}
file.close();
return lineCount;
}
int main() {
string filename;
cout << "Enter the file name: ";
cin >> filename;
return 0;
}
Output :
Program -2
Code :
#include <iostream>
double calculateFunctionPoints(int numInputs, int numOutputs, int numInquiries, int numFiles, int
numInterfaces) {
// Function Point weights for each type
const double inputWeight = 3.0;
const double outputWeight = 4.0;
const double inquiryWeight = 3.5;
const double fileWeight = 4.5;
const double interfaceWeight = 4.0;
return adjustedFP;
}
int main() {
int numInputs, numOutputs, numInquiries, numFiles, numInterfaces;
return 0;
}
Output :
Program -3
Code :
#include <iostream>
int main() {
double size, a, b, c, d, e, f;
return 0;
}
Output :