Cedrick Finalterm Comprog
Cedrick Finalterm Comprog
#include <iostream>
int main()
{
string verb1 = "happy";
string verb2 = "clap";
string verb3 = "turn";
cout << " If you're " << verb1 << " and you know it " << verb2 << " your hands
" << endl;
cout << " If you're " << verb1 << " and you know it " << verb2 << " your hands
" << endl;
cout << " If you're " << verb1 << " and you know it " << " and you really want
to show it " << endl;
cout << " If you're " << verb1 << " and you know it " << verb2 << " your hands
" << endl;
cout << " If you're " << verb1 << " and you know it " << verb3 << " around " <<
endl;
cout << " If you're " << verb1 << " and you know it " << verb3 << " around " <<
endl;
cout << " If you're " << verb1 << " and you know it " << " and you really want
to show it " << endl;
cout << " If you're " << verb1 << " and you know it " << verb3 << " around " <<
endl;
return 0;
}
2)
#include <iostream>
int main()
{
int numone ;
int numtwo ;
return 0;
}
3)
#include <iostream>
cout << " Input the length of the rectangle: " << endl;
cin >> Length ;
cout << " Input the width of the rectangle: " << endl;
cin >> Width ;
cout << " The perimeter of the rectangle: " << 2*(Length+Width)<< endl;
return 0;
}
4)
#include <iostream>
int main()
{
int HoursWorked;
int RateperHours ;
cout << " Salary: " << (HoursWorked * RateperHours) << endl;
return 0;
}
5)
#include <iostream>
int main()
{
int HoursWorked;
int RateperHours ;
int Salary ;
6)
#include <iostream>
int main()
{
int Integer;
cout << " Enter an Integer: " ;
cin >> Integer;
if ( Integer >= 0)
{
cout << " You entered a positive integer: " << Integer << endl;
}
else
{
cout << " You entered a negative integer: " << Integer << endl;
}
return 0;
}
7)
#include <iostream>
int main()
{
int Num;
cout << " Enter a Number: " ;
cin >> Num ;
8)
#include <iostream>
int main()
{
string Username = "cedrick";
string User;
string Password = "pogi";
string Passw;
if (
if ( Username == User && Password == Passw )
{
cout << " Access Granted ";
}
else
{
cout << " Access Denied ";
}
return 0;
}