Skip to content

Instantly share code, notes, and snippets.

@freakflames29
Created July 7, 2021 05:58
Show Gist options
  • Save freakflames29/49af6b8f5850df1472122ea08cce1cd3 to your computer and use it in GitHub Desktop.
Save freakflames29/49af6b8f5850df1472122ea08cce1cd3 to your computer and use it in GitHub Desktop.
hs and madhyamik marks calculator
#include <bits/stdc++.h>
using namespace std;
void madhya()
{
cout<<"Enter Your class 9 final marks of 7 subject out of 100\n";
float bengali,english,geography,math,physical_sc,life_sc,history;
cout<<"Enter bengali marks :- ";
cin>>bengali;
// cout<<endl;
cout<<"Enter english marks :- ";
cin>>english;
// cout<<endl;
cout<<"Enter geography marks :- ";
cin>>geography;
// cout<<endl;
cout<<"Enter history marks :- ";
cin>>history;
// cout<<endl;
cout<<"Enter math marks :- ";
cin>>math;
// cout<<endl;
cout<<"Enter physical_sc marks :- ";
cin>>physical_sc;
// cout<<endl;
cout<<"Enter life_sc marks :- ";
cin>>life_sc;
// cout<<endl;
cout<<"-----------------------------------------------------------\n";
cout<<"Now enter your class 10 practical or internal assestment marks of 7 subjects out of 10\n";
float ben,eng,geo,hist,lsc,psc,mth;
cout<<"Enter bengali marks :- ";
cin>>ben;
cout<<"Enter english marks :- ";
cin>>eng;
cout<<"Enter geography marks :- ";
cin>>geo;
cout<<"Enter history marks :- ";
cin>>hist;
cout<<"Enter math marks :- ";
cin>>mth;
cout<<"Enter physical science marks :- ";
cin>>psc;
cout<<"Enter life science marks :- ";
cin>>lsc;
int res_bengali=ceil(bengali/2)+(ben*5);
int res_english=ceil(english/2)+(eng*5);
int res_geography=ceil(geography/2)+(geo*5);
int res_history=ceil(history/2)+(hist*5);
int res_math=ceil(math/2)+(mth*5);
int res_physical_sc=ceil(physical_sc/2)+(psc*5);
int res_life_sc=ceil(life_sc/2)+(lsc*5);
cout<<"************************************\n";
cout<<"Your madhyamik result will be\n";
cout<<"bengali:- "<<res_bengali<<endl;
cout<<"english:- "<<res_english<<endl;
cout<<"geography:- "<<res_geography<<endl;
cout<<"history:- "<<res_history<<endl;
cout<<"math:- "<<res_math<<endl;
cout<<"Life science:- "<<res_life_sc<<endl;
cout<<"physical science:- "<<res_physical_sc<<endl;
int total=res_bengali+res_english+res_geography+res_history+res_math+res_physical_sc+res_life_sc;
float percent=float(total*100)/700;
cout<<"Total makrs :- "<<total<<endl;
cout<<"Total Percentage:- "<<fixed<<setprecision(2)<<percent<<"%\n";
}
void hs()
{
cout<<"Enter top 4 highest number of madhyamik outof 100\n";
float m1,m2,m3,m4;
cout<<"Enter 1st highest\n";
cin>>m1;
cout<<"Enter 2nd highest\n";
cin>>m2;
cout<<"Enter 3rd highest\n";
cin>>m3;
cout<<"Enter 4th highest\n";
cin>>m4;
int madh_thir=ceil(float(((m1+m2+m3+m4)*28.0)/400.0));
int madh_twe=ceil(float(((m1+m2+m3+m4)*32.0)/400.0));
float phy,chem,mth,bio,bengali,english;
cout<<"Enter Physics number of class 11 :- ";
cin>>phy;
cout<<"Enter Chemistry number of class 11 :- ";
cin>>chem;
cout<<"Enter Math number of class 11 :- ";
cin>>mth;
cout<<"Enter Biology number of class 11 :- ";
cin>>bio;
cout<<"Enter Bengali number of class 11 :- ";
cin>>bengali;
cout<<"Enter English number of class 11 :- ";
cin>>english;
cout<<"Enter your class 12 practical marks outof 30\n";
float prac_phy,prac_chem,prac_mth,prac_bio,prac_bengali,prac_english;
cout<<"Enter Physics number of class 12 practical :- ";
cin>>prac_phy;
cout<<"Enter Chemistry number of class 12 practical :- ";
cin>>prac_chem;
cout<<"Enter Biology number of class 12 practical :- ";
cin>>prac_bio;
cout<<"Enter your class 12 practical marks outof 20\n";
cout<<"Enter Math number of class 12 practical :- ";
cin>>prac_mth;
cout<<"Enter Bengali number of class 12 practical :- ";
cin>>prac_bengali;
cout<<"Enter English number of class 12 practical :- ";
cin>>prac_english;
int new_phy=ceil(float((42*phy)/70))+madh_thir+prac_phy;
int new_chem=ceil(float((42*chem)/70))+madh_thir+prac_chem;
int new_bio=ceil(float((42*bio)/70))+madh_thir+prac_bio;
int new_mth=ceil(float((48*mth)/80))+madh_twe+prac_mth;
int new_ben=ceil(float((48*bengali)/80))+madh_twe+prac_bengali;
int new_eng=ceil(float((48*english)/80))+madh_twe+prac_english;
cout<<"Your HS marks will be\n";
cout<<"Physics:- "<<new_phy<<endl;
cout<<"Chemistry:- "<<new_chem<<endl;
cout<<"Math:- "<<new_mth<<endl;
cout<<"Biology:- "<<new_bio<<endl;
cout<<"Bengali:- "<<new_ben<<endl;
cout<<"English:- "<<new_eng<<endl;
int all_total=new_phy+new_chem+new_mth+new_bio+new_ben+new_eng;
cout<<"All Total marks :- "<<all_total<<endl;
int minnum=min(new_phy,min(new_chem,min(new_bio,min(new_mth,min(new_eng,new_ben)))));
int total=all_total-minnum;
cout<<"Top marks outof 500 :- "<<total<<endl;
float percent=float((total*100)/500);
cout<<"Percentage:- "<<fixed<<setprecision(1)<<percent<<"%"<<endl;
}
int main()
{
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
// madhya();
// float real_pi=3.1745546546545;
// cout << setprecision(2) << " The Real_Pi is: " << real_pi << endl;
cout<<"Which result do you want to know?\n";
cout<<"if Madhyamik press 1\n";
cout<<"if HS press 2\n";
int choice;
cin>>choice;
if(choice==1)
madhya();
else if(choice==2)
hs();
else
cout<<"Wrong choice\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment