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

Assignment#02 QADEER AHMAD

That is Programming Assignment

Uploaded by

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

Assignment#02 QADEER AHMAD

That is Programming Assignment

Uploaded by

ZM TV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

// Name: QADEER AHMAD

// Roll no# 5014


// Degreee/Program (Section): BSSE evening B
// University of Okara
Assignment#02
// Question No# 8 = Consider the following program segment :
#include <iostream> // <a>
#include <string> // <a>
using namespace std; // <b>
int main()
{
const int SECRET = 11; // <c>
const double RATE = 12.50; //<c>
int num1,num2,newNum; // <d>
string name; // <d>
double hoursWorked,wages; // <d>

// <e>
cout<<"Enter first number :";
cin>>num1;
cout<<"Enter second number :";
cin>>num2;
cout<<endl;

// <f>
cout<<"The value of num1 is :"<<num1<<endl;
cout<<"The value of num2 is :"<<num2<<endl;

//<g>
newNum = (num1*2)+num2;
cout<<endl;
cout<<"New Number is :"<<newNum<<endl;
cout<<endl;

// <h>
newNum = newNum+SECRET;
cout<<"The value of New Number after updation is :"<<newNum<<endl;
cout<<endl;

// <i>
cout<<"Enter your last name :";
cin>>name;

// <j>
cout<<"Enter number between 0-70 :";
cin>>hoursWorked;

// <k>
cout<<endl;
wages = hoursWorked*RATE;

// <l>
cout<<"Name : "<<name<<endl;
cout<<"Pay Rate : $"<<RATE<<endl;
cout<<"Hours Worked : "<<hoursWorked<<endl;
cout<<"Salary : $"<<wages<<endl;

return 0; }

You might also like