0% found this document useful (0 votes)
19 views

Sample Programming Lab Report

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)
19 views

Sample Programming Lab Report

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
You are on page 1/ 3

ME-101L Sample Lab

Report

Department of Mechanical Engineering


University of Engineering & Technology
Main Campus, Peshawar

LAB Report # 1

ME-101L Lab Report Submitted By:

Name:

Registration No:

Section:

Submitted To:

Dr. Fakhre Alam Khan

Lab Date: Marks & Signature

Submission Date:
Objective(s):
 To be familiar with syntax and structure of C++ programming.
 To learn problem solving techniques using C++
Title:
Write a Program to calculate
Problem Analysis:
Input Processing Output Necessary header
variables variables/calculations variables files/functions/macros
(int) iostream
(int) (int)
(int)
Algorithm:
1. Start
2. Define variables: h(int), w(int), d(int), vol(int)
3. Assign value to variables: h = 10, w=12, d=8
4. Calculate the volume as: vol = h*w*d
5. Dishhhhhhplay the volume (vol)
6. Stop
Flowchart:
Code:

//Following code is written and compiled in Visual


Studio 2022.
#include<iostream>
using namespace std;
int main()
{
//start the program
int h, w, d, vol;
//variables declaration
h = 10;w = 12;d = 8;
//assign value to variables
vol = h * w * d;
//calculation using mathematical formula
cout << "The Volume of the cube is: " << vol;
//display the volume
system("pause>0");
//hold the screen until a key is pressed.
}
Output (Compilation, Debugging & Testing)
The Volume of the cube is: 960
Discussion and Conclusion
This is the first code written in C++ program. The program is focused on the calculation of
volume of a cube for the given height, width and depth. From this lab, I understood the basic
structure of C++ programming including the meaning of header files & steps of problem
solving. Hence, volume of a cube is calculated and displayed.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy