Professional Documents
Culture Documents
Assignment Task
Problem 1: Increment and Decrement operator
Your task is to dry run this program and draw box against each statement and write the actual value in the
box, for example for int x=10 X =10
#include<iostream>
using namespace std;
int main(){
int x=10;
cout<<"value of x is :"<<x<<endl;
cout<<"value of x is :"<<--x<<endl;
x++;
cout<<"value of x is :"<<x--<<endl;
x--;
cout<<"value of x is :"<<x++<<endl;
cout<<"value of x is :"<<x++<<endl;
int sum = 0;
cout<<"the value of sum is ="<<sum++<<endl;
sum = x--;
cout<<"the value of sum is ="<<sum--<<endl;
sum++;
cout<<"the value of sum is ="<<sum--<<endl;
sum += x++;
cout<<"the value of sum is ="<<sum<<endl;
1
Air University, Islamabad, Pakistan
Programming Fundamentals Lab, Spring 2024
Lab_4
Total Marks 100, Due Date: 11:59 pm, Friday 1st March, 2024
Important Notes: Comment each statement or block of statements and explain the purpose of each
statement or block of statements. The C++ program should compile and run without any errors against the
output given in this assignment. Marks or points will be deducted based on the following points:
Formatting [10 points]
Naming convention for variables [10 points]
Comments [10 points]
Missing loop where required [10 points]
Program doesn’t compile and run [70 points ]
Source code (java files) and executable file (.class file) missing [100 points]
Turn in to student’s portal (teams)
1) Write the program, follow steps, execute your program, capture output and submit a pdf file to
the portal (teams).
2) Submit source code: Shipping.cpp,
3) Execute all possible test cases and document your results in pdf against different inputs
4) We discussed memory types in detail. Copying, plagiarism, and sharing your answers with other
students is strictly prohibited and disciplinary action will be initiated against such students