Skip to content

Commit c6ac4ba

Browse files
committed
Test code pushed to repository.
0 parents  commit c6ac4ba

File tree

32 files changed

+886
-0
lines changed

32 files changed

+886
-0
lines changed

Age Detector/Main.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include<iostream>
2+
3+
using namespace std;
4+
5+
int main()
6+
7+
{
8+
9+
int a,b;
10+
11+
std::cin>>a>>b;
12+
13+
if(a>b)
14+
15+
{
16+
17+
int x = 1900+a;
18+
19+
int y = 2000+b;
20+
21+
std::cout<<y-x; }
22+
23+
else
24+
25+
{
26+
27+
int x = 2000+a;
28+
29+
int y = 2000+b;
30+
31+
std::cout<<y-x; }
32+
33+
}

Boating/Main.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int a,b,c;
6+
cin>>a>>b>>c;
7+
int d=(b*75)+(c*30);
8+
if (d>a)
9+
{
10+
cout<<"Boat will drow";
11+
}
12+
else
13+
{
14+
cout<<"Boat is stable";
15+
}
16+
return 0;
17+
//Type your code here.
18+
}

CGPA/Main.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include<iostream>
2+
int main()
3+
{
4+
float cgpa;
5+
std::cin>>cgpa;
6+
std::cout<<cgpa;
7+
}

Car mileage/Main.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include<iostream>
2+
3+
using namespace std;
4+
5+
int main()
6+
7+
{
8+
9+
int petrol,dist,possibleDist;
10+
11+
float milage;
12+
13+
std::cin>>milage>>petrol>>dist;
14+
15+
possibleDist=milage*petrol;
16+
17+
if(possibleDist >= dist)
18+
19+
std::cout<<"Can reach";
20+
21+
else
22+
23+
std::cout<<"Cannot reach";
24+
25+
return 0;
26+
27+
}

Check you typing speed! /Main.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int a,b;
6+
cin>>a;
7+
cin>>b;
8+
if(b>0)
9+
std::cout<<a<<" is eligible for reward.";
10+
else
11+
std::cout<<" ";
12+
return 0;
13+
}

Cricket/Main.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include<iostream>
2+
3+
#include<bits/stdc++.h>
4+
5+
using namespace std;
6+
7+
int main()
8+
9+
{
10+
11+
//Type your code here.
12+
13+
int tb,tr,cr,cb;
14+
15+
cin>>tb>>tr>>cr>>cb;
16+
17+
float t6=tb/6;
18+
19+
int t=cb/6;
20+
21+
int p=cb%6;
22+
23+
//cout<<cb%6;
24+
25+
float c6= ((float)t+ (float)p/10);
26+
27+
float crr=cr/c6;
28+
29+
float trr=tr/t6;
30+
31+
cout<<t6<<"\n"<<fixed << setprecision(1) <<c6<<"\n"<<crr<<"\n"<<trr;
32+
33+
if(crr>trr)
34+
35+
{
36+
37+
cout<<"\nEligible to Win";
38+
39+
}
40+
41+
else
42+
43+
cout<<"\nNot Eligible to Win";
44+
45+
return 0;
46+
47+
}

Dept Repay/Main.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include<iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int a,b,c;
6+
cin>>a;
7+
cin>>b;
8+
cin>>c;
9+
double intrest=(a*b*c)/100;
10+
cout<<intrest<<endl;
11+
double amount=(a+intrest);
12+
cout<<amount<<endl;
13+
double discount=(intrest*2)/100;
14+
cout<<discount<<endl;
15+
double finals=(amount-discount);
16+
cout<<finals;
17+
return 0;
18+
//Type your code here.
19+
}

Electricity Bill/Main.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
int main()
6+
7+
{
8+
9+
int unit;
10+
11+
int amt, total_amt, sur_charge;
12+
13+
cin>>unit;
14+
15+
if(unit <=200)
16+
17+
{
18+
19+
amt = unit * 0.50;
20+
21+
}
22+
23+
else if(unit <= 400)
24+
25+
{
26+
27+
amt = 100 + ((unit-200) * 0.65);
28+
29+
}
30+
31+
else if(unit <= 600)
32+
33+
{
34+
35+
amt = 200 + ((unit-400) * 0.80);
36+
37+
}
38+
39+
else
40+
41+
{
42+
43+
amt = 425 + ((unit-600) * 1.25);
44+
45+
}
46+
47+
sur_charge = amt * 0.001;
48+
49+
total_amt= amt + sur_charge;
50+
51+
cout<<"Rs."<<total_amt;
52+
53+
return 0;
54+
55+
}

Find the smallest number/Main.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include<iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int a,b;
6+
cin>>a>>b;
7+
if(a>b)
8+
{
9+
cout<<b<<" is smallest number";
10+
}
11+
else
12+
{
13+
cout<<a<<" is smallest number";
14+
}
15+
return 0;
16+
}

Four musketeers/Main.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include<iostream>
2+
3+
using namespace std;
4+
5+
int main()
6+
7+
{
8+
9+
float x1,x2,x3,y1,y2,y3,x,y;
10+
11+
cin>>x1;//2
12+
13+
cin>>y1;//4
14+
15+
cin>>x2;//10
16+
17+
cin>>y2;//15
18+
19+
cin>>x3;//5
20+
21+
cin>>y3;//8
22+
23+
x=(x1 + x2 + x3)/3;//5.66667
24+
25+
y=(y1 + y2 + y3)/3;//9
26+
27+
cout<<x<<"\n"<< y;
28+
29+
return 0;
30+
31+
}
32+

0 commit comments

Comments
 (0)