0% found this document useful (0 votes)
4 views14 pages

ITC Lab 5 Tasks

Uploaded by

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

ITC Lab 5 Tasks

Uploaded by

ehmili884
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

TASK 1:

#include <iostream>

using namespace std;

int main() {

int marks;

cout<<"Enter marks out of 100= ";

cin>>marks;

if(marks>50)

cout<<"Pass";

else

cout<<"Failed";

return 0;

TASK 2:

#include <iostream>

using namespace std;

int main() {

int n;

cout<<"Enter number= ";


cin>>n;

if(n%2==0)

cout<<"Even";

else

cout<<"Odd";

return 0;

TASK 3:

#include <iostream>

using namespace std;

int main() {

int age;

cout<<"Enter your age= ";

cin>>age;

if(age>=18)

cout<<"Eligible for vote";

else

cout<<"Not eligible";

return 0;
}

TASK 4:

#include <iostream>

using namespace std;

int main() {

int c=120,n,t,d,td;

cout<<"Enter amount= ";

cin>>n;

t=c*n;

if(n>5)

{d=(t*10)/100;

td=t-d;

cout<<"your total with discount is="<<td;}

else

cout<<"your total is="<<t;

return 0;

}
TASK 5:

#include <iostream>

using namespace std;

int main() {

int p=50,total,t,f;

cout<<"Enter number of hours parked=";

cin>>t;

total=p*t;

if(t>5)

{f=total+200;

cout<<"Your fee with fine= "<<f;}

else

cout<<"Your Fee is="<<total;

return 0;

}
TASK 6:

#include <iostream>

using namespace std;

int main() {

int t;

cout<<"Enter Temperature= ";

cin>>t;

if(t>30)

cout<<"Its hot today";

else

cout<<"Its pleasent Outside";

return 0;

TASK 7:

#include <iostream>
using namespace std;

int main() {

string c;

cout<<"Enter Traffic light color= ";

cin>>c;

if(c=="red"||c=="Red")

cout<<"Stop";

else if(c=="yellow"||c=="Yellow")

cout<<"Ready to go";

else if(c=="green"||c=="Green")

cout<<"Go";

else

cout<<"Enter valid color";

return 0;

TASK 8:

#include <iostream>

using namespace std;

int main() {
int t;

cout<<"Enter amount= ";

cin>>t;

if(t>5000)

cout<<"Congratulations you got dsicount!";

else

cout<<"No discuont";

return 0;

TASK 9:

#include <iostream>

using namespace std;

int main() {

int a,b,c;

cout<<"Enter First number= ";

cin>>a;

cout<<"Enter second number=";

cin>>b;

cout<<"Enter third number= ";

cin>>c;
if(a>b&&a>c)

cout<<"Largest numb is="<<a;

else if(b>a&&b>c)

cout<<"Largest numb is="<<b;

else if(c>>a&&c>>b)

cout<<"Largest numb is="<<c;

else

cout<<"Enter different numbers";

return 0;

TASK 10:

#include <iostream>

using namespace std;

int main() {

int m;
cout<<"Enter Marks Percent= ";

cin>>m;

if(m>90)

cout<<"Grade A";

else if(m>80)

cout<<"Grade B";

else if(m>70)

cout<<"Grade C";

else if(m>60)

cout<<"Grade D";

else

cout<<"Grade F";

return 0;

TASK 11:

#include <iostream>
using namespace std;

int main() {

int a,x,y,z;

cout<<"Enter the price Of laptop=";

cin>>a;

if(a>150000)

{cout<<"Discount=20%"<<endl;

x=(a*20)/100;

cout<<"Your discounted price="<<a-x;}

else if(a>=100000 && a<=150000)

{cout<<"Discount=10%"<<endl;

y=(a*10)/100;

cout<<"Your discounted price="<<a-y;}

else if(a>70000&&a<=99999)

{cout<<"Discount=5%"<<endl;

z=(a*5)/100;

cout<<"Your discounted price="<<a-z;}

else

cout<<"No discount";

return 0;22

}
TASK 12:

#include <iostream>

using namespace std;

int main() {

int a,x,y,z,d;

cout<<"Enter your units=";

cin>>a;

if(a<=100)

{cout<<"Unit price is 10Rs"<<endl;

x=a*10;

cout<<"Your bill is="<<x;}

else if(a>100 && a<=300)

{cout<<"Unit price is 15Rs"<<endl;

y=a*15;

cout<<"Your bill is="<<y;}

else if(a>300&&a<=500)

{cout<<"Unit price is 20Rs"<<endl;

z=a*20;
cout<<"Your bill is="<<z;}

else

{cout<<"Unit price is 25Rs"<<endl;

d=a*25;

cout<<"Your bill is="<<d;}

return 0;

TASK 13:

#include <iostream>

using namespace std;

int main() {

int movieType;

char st;

float p, d, fp;

cout << "Enter movie type (1 for Regular, 2 for 3D, 3 for VIP): ";

cin >> movieType;

if (movieType == 1)
p = 500;

else if (movieType == 2)

p = 800;

else if (movieType == 3)

p = 1200;

else {

cout << "Invalid movie type!" << endl;

return 0;

cout << "Are you a student? (y/n): ";

cin >> st;

if (st == 'y' || st == 'Y') {

d = (p * 20) / 100;

fp = p - d;

cout<<"Your discounted price is="<<fp;

} else {

fp = p;

cout<<"Discounted price is="<<fp;

You might also like