Funcom

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

#include <iostream> the while loop program

#include <conio.h>

int main ()
{
float c,k;
float i,s,a,x,y,z,w,r,e,n;
int q;
q=0;

while (q!=5)
{
++q;

cout<< "\n\nEnter Score 1:";


cin>> i;

cout<< "Enter Score 2:";


cin>> s;

cout<< "Enter Score 3:";


cin>> a;

cout<< "Enter Score 4:";


cin>> x;

cout<< "Enter Score 5:";


cin>> y;

cout<< "Enter Score 6:";


cin>> z;

cout<< "Enter Score 7:";


cin>> w;

cout<< "Enter Score 8:";


cin>> r;

cout<< "Enter Score 9:";


cin>> e;

cout<< "Enter Score 10:";


cin>> n;

c = (i+s+a+x+y+z+w+r+e+n)/1000;
k = c*100;

cout<<"The Percentage of a Student is "<<q<<" is "<<k<<"%";

if(k>100)
{
cout <<"\n\nINVALID";
}
else if (k<0)
{
cout <<"\n\nINVALID";
}
else if (k==100)
{
cout << "\n\nOUTSTANDING";
}
else if (k<100&&k>75)
{
cout <<"\n\nPASSED";
}
if (k<75&&k>=50)
{
cout << "\n\nCONDITIONAL";
}
if (k<50)
{
cout <<"\n\nFAILED";
}

}
getche ();
}
#include <iostream>
#include <conio.h>

int main ()
{
float c,k;
float i,s,a,x,y,z,w,r,e,n;
for (int q=1; q<=5; q++)
{
cout<< "\n\nEnter Score 1:";
cin>> i;

cout<< "Enter Score 2:";


cin>> s;

cout<< "Enter Score 3:";


cin>> a;

cout<< "Enter Score 4:";


cin>> x;

cout<< "Enter Score 5:";


cin>> y;

cout<< "Enter Score 6:";


cin>> z;

cout<< "Enter Score 7:";


cin>> w;

cout<< "Enter Score 8:";


cin>> r;

cout<< "Enter Score 9:";


cin>> e;

cout<< "Enter Score 10:";


cin>> n;

c = (i+s+a+x+y+z+w+r+e+n)/1000;
k = c*100;

cout<<"The Percentage of a Student is "<<q<<" is "<<k<<"%";

if(k>100)
{
cout <<"\n\nINVALID";
}
else if (k<0)
{
cout <<"\n\nINVALID";
}
else if (k==100)
{
cout << "\n\nOUTSTANDING";
}
else if (k<100&&k>=75)
{
cout <<"\n\nPASSED";
}
if (k<75&&k>=50)
{
cout << "\n\nCONDITIONAL";
}
if (k<50)
{
cout <<"\n\nFAILED";
}
getche ();
clrscr ();
}
getche ();
}

The for loop program


#include <iostream>
#include <conio.h>

int main ()
{
float c,k;
float i,s,a,x,y,z,w,r,e,n;
int q;
q=0;

do
{
++q;

cout<< "\n\nEnter Score 1:";


cin>> i;

cout<< "Enter Score 2:";


cin>> s;

cout<< "Enter Score 3:";


cin>> a;

cout<< "Enter Score 4:";


cin>> x;

cout<< "Enter Score 5:";


cin>> y;

cout<< "Enter Score 6:";


cin>> z;

cout<< "Enter Score 7:";


cin>> w;

cout<< "Enter Score 8:";


cin>> r;

cout<< "Enter Score 9:";


cin>> e;

cout<< "Enter Score 10:";


cin>> n;

c = (i+s+a+x+y+z+w+r+e+n)/1000;
k = c*100;

cout<<"The Percentage of a Student is "<<q<<" is "<<k<<"%";

if(k>100)
{
cout <<"\n\nINVALID";
}
else if (k<0)
{
cout <<"\n\nINVALID";
}
else if (k==100)
{
cout << "\n\nOUTSTANDING";
}
else if (k<100&&k>=75)
{
cout <<"\n\nPASSED";
}
if (k<75&&k>=50)
{
cout << "\n\nCONDITIONAL";
}
if (k<50)
{
cout <<"\n\nFAILED";
}
getche ();
clrscr ();
}
while (q!=5);

getche ();
}
The do while loop program
#include <iostream>
#include <conio.h>

int main ()
{
int score;
cout << "Enter score: ";
cin >> score;
if (score>100)
{
cout << "HIGH";
}
else
cout << "LOW";

getche ();
}

Sample program

#include <iostream>
#include <conio.h>

int main ()
{
int x;
cout << "How many greetings do you want? ";
cin >> x;
do
{
cout << "Hello\t";
x--;
}
while (x>0);
cout << "\n That's all!";

getche ();
}

The sample program #2


#include <iostream>
#include <conio>

int main ()
{
int q;
q=0;

while (q!=9500)
{
++q;

gotoxy (31,12);
cout << "Welcome FUNCOM 123";
}
clrscr ();

for (int z=0; z<=9900; ++z)


{

gotoxy (78,40);
cout << "0%";
}
clrscr ();

for (int y=0; y<=9900; ++y)


{

gotoxy (1,40);
cout << "[][][][][] 5%";
}
clrscr ();

for (int x=0; x<=9900; ++x)


{

gotoxy (1,40);
cout << "[][][][][][][][][][][] 20%";
}
clrscr ();

for (int w=0; w<=9900; ++w)


{

gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][] 50%";
}
clrscr ();

for (int v=0; v<=9900; ++v)


{

gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][][][][][][] 78%";
}
clrscr ();

for (int u=0; u<=9900; ++u)


{

gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] 92%";
}
clrscr ();
for (int t=0; t<=9900; ++t)
{

gotoxy (1,40);
cout << "[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]100%";
}
clrscr ();

gotoxy(1,8);
cout<<"\n\t\t xxxxxx xxxxxx";
cout<<"\n\t\t xx xx xx xx";
cout<<"\n\t\t xxx xxx xxx xxx";
cout<<"\n\t\t ";
cout<<"\n\t\t ";
cout<<"\n\t\t xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
cout<<"\n\t\t xx xx";
cout<<"\n\t\t xx xx";
cout<<"\n\t\t x x";
cout<<"\n\t\t xxxxx xxxxx";
cout<<"\n\t\t xxxxxxxxxxx";

getche ();
}

You might also like