You are on page 1of 2

// Name: QADEER AHMAD

// Roll no# 5014


// Degreee/Program (Section): BSSE evening B
// University of Okara

// 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