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

Cedrick Finalterm Comprog

Uploaded by

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

Cedrick Finalterm Comprog

Uploaded by

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

1)

#include <iostream>

using namespace std;

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>

using namespace std;

int main()
{
int numone ;
int numtwo ;

cout << " Enter Number 1: " << endl;


cin >> numone ;

cout << " Enter Number 2: " << endl;


cin >> numtwo ;

cout << " Average: " << (numone+numtwo)/2 << endl;

return 0;
}

3)
#include <iostream>

using namespace std;


int main()
{
int Length ;
int Width ;

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>

using namespace std;

int main()
{
int HoursWorked;
int RateperHours ;

cout << " Worked Hours: " << endl;


cin >> HoursWorked;

cout << " Rate per Hour: " << endl;


cin >> RateperHours ;

cout << " Salary: " << (HoursWorked * RateperHours) << endl;

return 0;
}

5)
#include <iostream>

using namespace std;

int main()
{
int HoursWorked;
int RateperHours ;

cout << " Worked Hours: " << endl;


cin >> HoursWorked;

cout << " Rate per Hour: " << endl;


cin >> RateperHours ;
cout << " Salary: " << (HoursWorked * RateperHours) << endl;

int Salary ;

cout << " Salary Pay:" << endl;

if ( (HoursWorked * RateperHours) > 20000)


{
cout << " High Pay ";
}
else
{
cout << " Low Pay ";
}
return 0;
}

6)
#include <iostream>

using namespace std;

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>

using namespace std;

int main()
{
int Num;
cout << " Enter a Number: " ;
cin >> Num ;

if ( Num >= 0 && Num <= 40)


{
cout << " BLUE ";
}
else if ( Num >= 41 && Num <= 80)
{
cout << " RED ";
}
else if ( Num >= 81 && Num <= 100)
{
cout << " YELLOW ";
}
else
{
cout << " WHITE";
}
return 0;
}

8)
#include <iostream>

using namespace std;

int main()
{
string Username = "cedrick";
string User;
string Password = "pogi";
string Passw;

cout << " Enter Username: ";


cin >> User ;

cout << " Enter Password: ";


cin >> Passw ;

if (
if ( Username == User && Password == Passw )
{
cout << " Access Granted ";
}
else
{
cout << " Access Denied ";
}

return 0;
}

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