Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,149 members, 7,807,491 topics. Date: Wednesday, 24 April 2024 at 02:09 PM

My C++ CGPA Calculator Program - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / My C++ CGPA Calculator Program (5428 Views)

My Semester GPA Calculator With Javascript / Javascript Source Code For GPA Calculator / Ceemate (for All Undergraduates ) CGPA calculator (2) (3) (4)

(1) (Reply) (Go Down)

My C++ CGPA Calculator Program by ibromodzi: 5:42pm On Oct 29, 2017
//The program calculates the gpa/cgpa based on the commonest grading
//system via 4.0,5.0 and 7.0.
//The user is asked whether he is calculating for cgpa/gpa and also the

//grade system

#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;


class Cgpa//The base class that holds all the vectors and functions
{
protected:
double gpa;
double cgpa;
int coursenumber;
vector<double>courseunit;//for various course unit
vector<double>gradeequivalent;//point equivalent to the grade
vector<double>unitsum;//sums the total unit
vector<double>gradevsunit;//multiplies grade and unit
vector<double>sumgradevsunit;//sum of the grade and unit multiplied

public:
Cgpa();
Cgpa(double cnumber):
coursenumber(cnumber),courseunit(cnumber),gradeequivalent(cnumber),
unitsum(cnumber),gradevsunit(cnumber),sumgradevsunit(cnumber){}
void getunit();
void getgrade();
double dounitsum();
void multiplygradeunit();
double dosumgradevsunit();
double dogpa(int Tpoint,int Tunit);
double docgpa(int T,int P);
void grading(int Tp,int Tu);
void gradecgpa(int U,int G);
void gradeinfo();//displays the point equivalent to the user

};

class Fourpoint: public Cgpa//derived class for 4.0 grading system
{
public:
Fourpoint(int cnumber):Cgpa(cnumber){}
void gradeinfo4();
void grading4(int a,int b);
void grading4b(int a,int b);

private:
double gpa4;
double cgpa4;

};

class Sevenpoint: public Cgpa//derived class for 7.0 grading system
{
public:
Sevenpoint(int cnumber):Cgpa(cnumber){}
void gradeinfo7();
void grading7(int a,int b);
void grading7b(int c,int d);
private:
double gpa7;
double cgpa7;

};
//class Implementations
void Cgpa::getunit()
{
for(int i = 0;i<coursenumber; i++)
{
cout<<"Input the unit for course "<<i+1<<": ";
cin>>courseunit[i];
}
}
void Cgpa::gradeinfo()
{
cout<<"Enter the point equivalent to the grade scored i.e A is 5 B 4, C 3, D 2, E 1, F 1\n";
}
void Cgpa::getgrade()
{

for(int i = 0; i<coursenumber; i++)
{
cout<<"Input the gradeequivalent for course "<<i+1<<": ";
cin>>gradeequivalent[i];
}
}

double Cgpa::dounitsum()
{
int sumunit = 0;
for(int i = 0; i<coursenumber; i++)
{
sumunit = sumunit + courseunit[i];
}
return sumunit;
}
void Cgpa::multiplygradeunit()
{
for(int i = 0; i<coursenumber; i++)
{
gradevsunit[i] = courseunit[i] * gradeequivalent[i];
}
}
double Cgpa::dosumgradevsunit()
{
int sumgradeAndUnit = 0;
for(int i = 0; i<coursenumber; i++)
{
sumgradeAndUnit = sumgradeAndUnit + gradevsunit[i];
}
return sumgradeAndUnit;
}
double Cgpa::dogpa(int Tpoint,int Tunit)
{
return Tpoint/static_cast<double>(Tunit);
}
double Cgpa::docgpa(int T,int P)
{
return T/static_cast<double>(P);
}
void Cgpa::grading(int Tp,int Tu)
{
gpa = dogpa(Tp,Tu);
if(gpa >= 4.5)
{
cout<<"\nYour GPA is "<<gpa<<" which corresponds to the FIRST CLASS division\n What an exellent performance! Keep it up."<<endl;
}
else if(gpa >= 3.5 && gpa < 4.50)
{
cout<<"\nYour GPA is "<<gpa<<" which corresponds to the SECOND CLASS UPPER division\n That's a good performance, just some points away from first class. Strive harder next time"<<endl;
}
else if(gpa >= 2.5 && gpa < 3.5)
{
cout<<"\nYour GPA is "<<gpa<<" which corresponds to the SECOND CLASS LOWER division\n You can still do better, just some points away from second class upper. Strive harder next time"<<endl;
}
else if(gpa >= 1.5 && gpa < 2.5)
{
cout<<"\nYour GPA is "<<gpa<<" which corresponds to the THIRD CLASS division\n You are born to be great. Double your hustle to be in the class you belong to. You can always do better\n";
}
else
{
cout<<"\nYour GPA is"<<gpa<<" which corresponds to the PASS category\n Being in this category does not imply that you are so poor academically, it only gives you a challenge of life which you must face. Sit yourself down and think of the best way(s) possible to sort things out, if possible, try to talk to the experienced ones or probably meet a coucellor\n Wish you best of luck!"<<endl;

}
}
void Cgpa::gradecgpa(int U,int G)
{
cgpa = docgpa(U,G);
if(cgpa >= 4.5)
{
cout<<"\nYour CGPA is "<<cgpa<<" which corresponds to the FIRST CLASS division \n What an exellent performance! Keep it up. "<<endl;
}
else if(cgpa >= 3.5 && cgpa < 4.50)
{
cout<<"\nYour CGPA is "<<cgpa<<" which corresponds to the SECOND CLASS UPPER division\n That's a good performance, just some points away from first class. Strive harder next time "<<endl;
}
else if(cgpa >= 2.5 && cgpa < 3.5)
{
cout<<"\nYour CGPA is "<<cgpa<<" which corresponds to the SECOND CLASS LOWER division\n You can still do better, just some points away from second class upper. Strive harder next time "<<endl;
}
else if(cgpa >= 1.5 && cgpa < 2.5)
{
cout<<"\nYour CGPA is "<<cgpa<<" which corresponds to the THIRD CLASS division\n You are born to be great. Double your hustle to be in the class you belong to. You can always do better \n";
}
else
{
cout<<"\nYour CGPA is"<<cgpa<<" which corresponds to the PASS category\n Being in this category does not imply that you are so poor academically, it only gives you a challenge of life which you must face. Sit yourself down and think of the best way(s) possible to sort things out, if possible, try to talk to the experienced ones or probably meet a coucellor\n Wish you best of luck! "<<endl;

}
}

void Fourpoint::gradeinfo4()
{
cout<<"Enter the point equivalent to the grade scored i.e A is 4.0,AB 3.5,B 3.0, etc.\n";
}
void Fourpoint::grading4(int a,int b)
{
gpa4 = dogpa(a,b);
if(gpa4>=3.5)
{
cout<<"Your GPA is "<<gpa4<<"which corresponds to DISTINCTION\n What an exellent performance! Keep it up. ";
}
else if(gpa4 >= 3.0 && gpa4 <= 3.49)
{
cout<<"Your GPA is "<<gpa4<<" which corresponds to the UPPER CREDIT division\n That's a good performance, just some points away from distinction. Strive harder next time\n";
}
else if(gpa4 >= 2.5 && gpa4 <= 2.99)
{
cout<<"Your GPA is "<<gpa4<<" which corresponds to the LOWER CREDIT division\n You can still do better, just some points away from upper credit. Strive harder next time\n";
}
else if(gpa4 >= 2.00 && gpa4 <= 2.49)
{
cout<<"Your GPA is "<<gpa4<<" which corresponds to PASS\n You are born to be great. Double your hustle to be in the class you belong to. You can always do better \n";
}
else
{
cout<<"Your GPA is "<<gpa4<<" which corresponds to FAIL\n Being in this category does not imply that you are so poor academically, it only gives you a challenge of life which you must face. Sit yourself down and think of the best way(s) possible to sort things out, if possible, try to talk to the experienced ones or probably meet a coucellor\n Wish you best of luck! \n";
}


}
void Fourpoint::grading4b(int a,int b)
{
cgpa4 = dogpa(a,b);
if(cgpa4>=3.5)
{
cout<<"Your CGPA is "<<cgpa4<<"which corresponds to DISTINCTION\n What an exellent performance! Keep it up. ";
}
else if(cgpa4 >= 3.0 && cgpa4 <= 3.49)
{
cout<<"Your CGPA is "<<cgpa4<<" which corresponds to the UPPER CREDIT division\n That's a good performance, just some points away from distiction. Strive harder next time\n";
}
else if(cgpa4 >= 2.5 && cgpa4 <= 2.99)
{
cout<<"Your CGPA is "<<cgpa4<<" which corresponds to the LOWER CREDIT division\n You can still do better, just some points away from upper credit. Strive harder next time \n";
}
else if(cgpa4 >= 2.00 && cgpa4 <= 2.49)
{
cout<<"Your CGPA is "<<cgpa4<<" which corresponds to PASS\n You are born to be great. Double your hustle to be in the class you belong to. You can always do better \n";
}
else
{
cout<<"Your CGPA is "<<cgpa4<<" which corresponds to FAIL\n Being in this category does not imply that you are so poor academically, it only gives you a challenge of life which you must face. Sit yourself down and think of the best way(s) possible to sort things out, if possible, try to talk to the experienced ones or probably meet a coucellor\n Wish you best of luck! \n";
}
}
void Sevenpoint::gradeinfo7()
{
cout<<"Enter the point equivalent to the grade scored i.e A is 7.0,B 3.5,B 6.0,C 5,D 4/3, E 2/1 F 0 \n";
}
void Sevenpoint::grading7(int a, int b)
{
gpa7 = dogpa(a,b);
if(gpa7 >= 6)
{
cout<<"\nYour GPA is "<<gpa7<<" which corresponds to the FIRST CLASS division\n What an exellent performance! Keep it up. "<<endl;
}
else if(gpa7 >= 4.6 && gpa7 <= 5.99)
{
cout<<"\nYour GPA is "<<gpa7<<" which corresponds to the SECOND CLASS UPPER division\n That's a good performance, just some points away from first class. Strive harder next time"<<endl;
}
else if(gpa7 >= 2.6 && gpa7 <= 4.59)
{
cout<<"\nYour GPA is "<<gpa7<<" which corresponds to the SECOND CLASS LOWER division\n You can still do better, just some points away from second class upper. Strive harder next time "<<endl;
}
else if(gpa7 >= 1.6 && gpa7 <= 2.59)
{
cout<<"\nYour GPA is "<<gpa7<<" which corresponds to the THIRD CLASS division\n You are born to be great. Double your hustle to be in the class you belong to. You can always do better \n";
}
else
{
cout<<"\nYour GPA is"<<gpa7<<" which corresponds to the PASS category\n Being in this category does not imply that you are so poor academically, it only gives you a challenge of life which you must face. Sit yourself down and think of the best way(s) possible to sort things out, if possible, try to talk to the experienced ones or probably meet a coucellor\n Wish you best of luck! "<<endl;

}
}
void Sevenpoint::grading7b(int c,int d)
{
cgpa7 = dogpa(c,d);
if(cgpa7 >= 6)
{
cout<<"\nYour CGPA is "<<cgpa7<<" which corresponds to the FIRST CLASS division\n What an exellent performance! Keep it up. "<<endl;
}
else if(cgpa7 >= 4.6 && cgpa7 <= 5.99)
{
cout<<"\nYour CGPA is "<<cgpa7<<" which corresponds to the SECOND CLASS UPPER division\n That's a good performance, just some points away from first class. Strive harder next time" <<endl;
}
else if(cgpa7 >= 2.6 && cgpa7 <= 4.59)
{
cout<<"\nYour CGPA is "<<cgpa7<<" which corresponds to the SECOND CLASS LOWER division\n You can still do better, just some points away from second class upper. Strive harder next time "<<endl;
}
else if(cgpa7 >= 1.6 && cgpa7 <= 2.59)
{
cout<<"\nYour CGPA is "<<cgpa7<<" which corresponds to the THIRD CLASS division\n You are born to be great. Double your hustle to be in the class you belong to. You can always do better \n";
}
else
{
cout<<"\nYour CGPA is"<<cgpa7<<" which corresponds to the PASS category\n Being in this category does not imply that you are so poor academically, it only gives you a challenge of life which you must face. Sit yourself down and think of the best way(s) possible to sort things out, if possible, try to talk to the experienced ones or probably meet a coucellor\n Wish you best of luck! "<<endl;

}
}
//Application
int main()
{
cout.setf(ios::fixed); //setting the
cout.setf(ios::showpoint); //points to come
cout.precision(2); //after decimal
int n,a;//represents the call to constructor n
double Totalunit,Gradevsunit;
char ans;
double grade;
cout<<" ********************************************\n";
cout<<" ~~~~~~~~~~~~~~~~~CGPA CALCULATOR~~~~~~~~~~~~~~~~~~~~~~~~\n";
cout<<"Designed to calculate your gpa/cgpa effectively\n";
cout<<"Wish you good luck as you calculate\n";
cout<<"Are you calculating your GPA or CGPA? GPA is just a semester result while CGPA is a sessional result. Input a for GPA or b for CGPA\n";
cin>>ans;
cout<<"What's your school's grading system 4.0,5.0 or 7.0\n";
cin>>grade;

if(ans=='a' && grade == 5.0)
{
cout<<"Enter the total number of courses offered for the semester\n";
cin>>n;

Cgpa semester(n);
semester.getunit();
semester.gradeinfo();
semester.getgrade();
Totalunit = semester.dounitsum();
semester.multiplygradeunit();
Gradevsunit = semester.dosumgradevsunit();
semester.dogpa(Gradevsunit,Totalunit);
semester.grading(Gradevsunit,Totalunit);
}
else if(ans == 'b' && grade == 5.0)
{
cout<<" INPUT FOR FIRST SEMESTER\n";
cout<<"Enter the total number of courses offered in first semester\n";
cin>>n;
Cgpa semester1(n);
semester1.getunit();
semester1.gradeinfo();
semester1.getgrade();
double Totalunit1 = semester1.dounitsum();
semester1.multiplygradeunit();
double Gradevsunit1 = semester1.dosumgradevsunit();
double gpa = semester1.dogpa(Gradevsunit1,Totalunit1);
cout<<"\nYour gpa for first semester is "<<gpa<<endl;

cout<<" INPUT FOR SECOND SEMESTER\n";
cout<< "Enter the total number of courses offered in second semester\n";
cin>>a;
Cgpa sessional(a);
sessional.getunit();
sessional.getgrade();
double Totalunit2 = sessional.dounitsum();
sessional.multiplygradeunit();
double Gradevsunit2 = sessional.dosumgradevsunit();
double gpa2 = sessional.dogpa(Gradevsunit2,Totalunit2);
cout<<"\nYour gpa for second semester is "<<gpa2<<endl;

double Unit = Totalunit1 + Totalunit2;
double Grade = Gradevsunit1 + Gradevsunit2;
double cgpa = sessional.docgpa(Unit,Grade);
sessional.gradecgpa(Grade,Unit);



}
else if(ans =='a' && grade == 4.0)
{
int b;
cout<<"Enter the total number of courses offered for the semester\n";
cin>>b;
Fourpoint gpa4(b);
gpa4.getunit();
gpa4.gradeinfo4();
gpa4.getgrade();
Totalunit = gpa4.dounitsum();
gpa4.multiplygradeunit();
Gradevsunit = gpa4.dosumgradevsunit();
gpa4.dogpa(Gradevsunit,Totalunit);
gpa4.grading4(Gradevsunit,Totalunit);

}
else if(ans=='b' && grade == 4.0)
{
cout<<" INPUT FOR FIRST SEMESTER\n";
cout<<"Enter the total number of courses offered in first semester\n";
cin>>n;
Fourpoint gpa41(n);
gpa41.getunit();
gpa41.gradeinfo4();
gpa41.getgrade();
double Totalunit41 = gpa41.dounitsum();
gpa41.multiplygradeunit();
double Gradevsunit41 = gpa41.dosumgradevsunit();
double gpa41a = gpa41.dogpa(Gradevsunit41,Totalunit41);
cout<<"\nYour GPA for first semester is "<<gpa41a<<endl;

cout<<" INPUT FOR SECOND SEMESTER\n";
cout<< "Enter the total number of courses offered in second semester\n";
cin>>n;
Fourpoint gpa42(n);
gpa42.getunit();
gpa42.gradeinfo4();
gpa42.getgrade();
double Totalunit42 = gpa42.dounitsum();
gpa42.multiplygradeunit();
double Gradevsunit42 = gpa42.dosumgradevsunit();
double gpa42a = gpa42.dogpa(Gradevsunit42,Totalunit42);

cout<<"\nYour GPA for second semester is "<<gpa42a<<endl;

double Unit4 = Totalunit41 + Totalunit42;
double Grade4 = Gradevsunit41 + Gradevsunit42;
gpa42.grading4b(Grade4,Unit4);


}
else if(ans=='a' && grade==7.0)
{
cout<<"Enter the total number of courses offered for the semester\n";
cin>>n;
Sevenpoint gpa7(n);
gpa7.getunit();
gpa7.gradeinfo7();
gpa7.getgrade();
Totalunit = gpa7.dounitsum();
gpa7.multiplygradeunit();
Gradevsunit = gpa7.dosumgradevsunit();
gpa7.dogpa(Gradevsunit,Totalunit);
gpa7.grading7(Gradevsunit,Totalunit);
}

else if(ans =='b' && grade ==7.0)
{
cout<<" INPUT FOR FIRST SEMESTER\n";
cout<<"Enter the total number of courses offered in first semester\n";
cin>>n;
Sevenpoint gpa71(n);
gpa71.getunit();
gpa71.gradeinfo7();
gpa71.getgrade();
double Totalunit71 = gpa71.dounitsum();
gpa71.multiplygradeunit();
double Gradevsunit71 = gpa71.dosumgradevsunit();
double gpa71a = gpa71.dogpa(Gradevsunit71,Totalunit71);
cout<<"\nYour GPA for first semester is "<<gpa71a<<endl;

cout<<" INPUT FOR SECOND SEMESTER\n";
cout<< "Enter the total number of courses offered in second semester\n";
cin>>n;
Sevenpoint gpa72(n);
gpa72.getunit();
gpa72.gradeinfo7();
gpa72.getgrade();
double Totalunit72 = gpa72.dounitsum();
gpa72.multiplygradeunit();
double Gradevsunit72 = gpa72.dosumgradevsunit();
double gpa72a = gpa72.dogpa(Gradevsunit72,Totalunit72);

cout<<"\nYour GPA for second semester is "<<gpa72a<<endl;

double Unit7 = Totalunit71 + Totalunit72;
double Grade7 = Gradevsunit71 + Gradevsunit72;
gpa72.grading7b(Grade7,Unit7);
}
else
{
cout<<"\nEither the grading system or input for cgpa/gpa is wrong. Rerun the program";
exit(1);

}

}
Re: My C++ CGPA Calculator Program by ibromodzi: 5:49pm On Oct 29, 2017
It's my first code in OOP though plus I'm just a beginner. I would like to create a mobile app with this but don't have the necessary resources right now.
Any idea on how to improve it is welcomed.
Re: My C++ CGPA Calculator Program by Nobody: 11:44pm On Oct 29, 2017
hey, first I must commend your effort for trying to learn programming, while other youths of this country are busy dancing "One Corner " lol

but on a serious note, this is bad coding practice, you need to learn how to break your codes into classes,

with multiple descriptive classes preforming a single task, you can make your codes more easier to read and maintain.

but don't worry, it's just a matter of time you will only get better.

I have been coding for top companies for several years, so take my advice. always ensure your codes are readable and as small as possible.

cheers

1 Like

Re: My C++ CGPA Calculator Program by LordeCalifornia: 2:45pm On Oct 30, 2017
Lol. I love the advice notes. "You are born to be great! Double your hustle cheesy "
Re: My C++ CGPA Calculator Program by samueltoski: 7:40pm On Oct 30, 2017
go and learn QT it would help you design the GUI
Re: My C++ CGPA Calculator Program by Sirnuel: 10:22pm On Oct 30, 2017
go an learn object oriented programing


reason why i love java, it forces you to learn oop right from your very first hello world

nice job by the way
Re: My C++ CGPA Calculator Program by ibromodzi: 5:30am On Oct 31, 2017
Ezechinwa:
hey, first I must commend your effort for trying to learn programming, while other youths of this country are busy dancing "One Corner " lol

but on a serious note, this is bad coding practice, you need to learn how to break your codes into classes,

with multiple descriptive classes preforming a single task, you can make your codes more easier to read and maintain.

but don't worry, it's just a matter of time you will only get better.

I have been coding for top companies for several years, so take my advice. always ensure your codes are readable and as small as possible.

cheers
Thanks boss
I would have love to do that but you won't believe that the code is written with an android compiler and also I do type with a mouse which makes it very tiring for me to implement separate file compilations. But I must shaa do something till I have a working PC.
Thanks once again.

1 Like

Re: My C++ CGPA Calculator Program by ibromodzi: 7:24am On Oct 31, 2017
LordeCalifornia:
Lol. I love the advice notes. "You are born to be great! Double your hustle cheesy "
Lol
Re: My C++ CGPA Calculator Program by ibromodzi: 7:25am On Oct 31, 2017
Sirnuel:
go an learn object oriented programing


reason why i love java, it forces you to learn oop right from your very first hello world

nice job by the way
I should go and learn OOP? so what do you call this?
Re: My C++ CGPA Calculator Program by ibromodzi: 7:26am On Oct 31, 2017
samueltoski:
go and learn QT it would help you design the GUI
OK Thanks
Re: My C++ CGPA Calculator Program by olamil34(m): 7:43am On Oct 31, 2017
ibromodzi:
It's my first code in OOP though plus I'm just a beginner. I would like to create a mobile app with this but don't have the necessary resources right now.
Any idea on how to improve it is welcomed.

please come learn python
Re: My C++ CGPA Calculator Program by ibromodzi: 7:50am On Oct 31, 2017
olamil34:

please come learn python
I'll learn that later....but why?
Re: My C++ CGPA Calculator Program by Maj196(m): 8:27am On Oct 31, 2017
ibromodzi:

I'll learn that later....but why?
Python is more easier and requires lesser coding.
Re: My C++ CGPA Calculator Program by ibromodzi: 9:09am On Oct 31, 2017
Maj196:
Python is more easier and requires lesser coding.
And that's why I love c++ more...because it isn't as easy as most programming languages.
Re: My C++ CGPA Calculator Program by LordeCalifornia: 2:58pm On Oct 31, 2017
ibromodzi:
It's my first code in OOP though plus I'm just a beginner. I would like to create a mobile app with this but don't have the necessary resources right now.
Any idea on how to improve it is welcomed.
What are the resources you need to make this a mobile app?
Re: My C++ CGPA Calculator Program by ibromodzi: 4:38pm On Oct 31, 2017
LordeCalifornia:
What are the resources you need to make this a mobile app?
I really don't know. Any hint?
Re: My C++ CGPA Calculator Program by LordeCalifornia: 8:24pm On Oct 31, 2017
ibromodzi:

I really don't know. Any hint?
Nope. I'm equally a beginner.
Re: My C++ CGPA Calculator Program by ibromodzi: 8:42pm On Oct 31, 2017
LordeCalifornia:

Nope. I'm equally a beginner.
OK
Can we hook up? I'm thinking of creating a WhatsApp group for beginners like us so that we can share ideas and possibly help one another. What do you think?
Re: My C++ CGPA Calculator Program by LordeCalifornia: 8:46pm On Oct 31, 2017
ibromodzi:

OK
Can we hook up? I'm thinking of creating a WhatsApp group for beginners like us so that we can share ideas and possibly help one another. What do you think?
I'm all in. Drop your WhatsApp number let me send you a message.
Re: My C++ CGPA Calculator Program by ibromodzi: 9:15pm On Oct 31, 2017
LordeCalifornia:
I'm all in. Drop your WhatsApp number let me send you a message.
08164402922
Re: My C++ CGPA Calculator Program by Akin1212(m): 11:31pm On Oct 31, 2017
ibromodzi:

I really don't know. Any hint?

To make it an android app, you need VISUAL STUDIO. Especially 2017 version. You can make it a shared library code for both Android and iOS. See my Visual studio below

Re: My C++ CGPA Calculator Program by ibromodzi: 1:57am On Nov 01, 2017
Akin1212:


To make it an android app, you need VISUAL STUDIO. Especially 2017 version. You can make it a shared library code for both Android and iOS. See my Visual studio below
Nice one boss....Thanks very much.
Re: My C++ CGPA Calculator Program by kwaghe0001(m): 10:16am On Nov 01, 2017
Pls I needed help from you guys as a great programmers on this. Write a c++ program to determine the largest of three numbers using conditions ternary operator and develop a program to generate the tables 2 to 12, that is, 2*1*2, 2*2=4 up to 12*12=144
Re: My C++ CGPA Calculator Program by ibromodzi: 11:49am On Nov 01, 2017
kwaghe0001:
Pls I needed help from you guys as a great programmers on this. Write a c++ program to determine the largest of three numbers using conditions ternary operator and develop a program to generate the tables 2 to 12, that is, 2*1*2, 2*2=4 up to 12*12=144
I think there exist an algorithm for the multiplication table that u can easily Google it. However u can check this solution of mine out

As for the first one, just declare three variables say a,b,c
then use this syntax. (a>b && a<c) ? a : (b>c?b:c)
hope that helps

1 Like

Re: My C++ CGPA Calculator Program by Nicolars(m): 7:45pm On Nov 07, 2017
ibromodzi:

08164402922

FAM, I'm also a beginner ...
Learning both c++ and c# together...
My number: 08117930416

I'm in oop but I'm really having difficulties in understanding the necessity of each techniques; interface,inheritance ,blah blah...

When do you know its time to use this or another...
Re: My C++ CGPA Calculator Program by CHISOMPHILIP(m): 7:52am On Nov 08, 2017
So much appreciate this trend...Thumbs up to all beginners as we learn to code our way through the thug of life.

please you can equally add me to the whatsap group.
<<07065667321>>
Re: My C++ CGPA Calculator Program by Edoziesmart(m): 12:41pm On Nov 08, 2017
You tried alot. But you would have use c4droid compiler than using this cppdroid.
It have a great features.
At least you can convert your code to Android app using c4droid though the app will be in terminal form since it wasn't build using qt library.
With c4droid you can learn cpp ui using qt and qml.
Try using the aforementioned compiler while you wait for a working PC.
Re: My C++ CGPA Calculator Program by kunletoks(m): 12:54pm On Nov 08, 2017
Ezechinwa:
hey, first I must commend your effort for trying to learn programming, while other youths of this country are busy dancing "One Corner " lol

but on a serious note, this is bad coding practice, you need to learn how to break your codes into classes,

with multiple descriptive classes preforming a single task, you can make your codes more easier to read and maintain.

but don't worry, it's just a matter of time you will only get better.

I have been coding for top companies for several years, so take my advice. always ensure your codes are readable and as small as possible.

cheers

Nice observation.
Re: My C++ CGPA Calculator Program by ibromodzi: 9:12pm On Nov 08, 2017
Edoziesmart:
You tried alot. But you would have use c4droid compiler than using this cppdroid.
It have a great features.
At least you can convert your code to Android app using c4droid though the app will be in terminal form since it wasn't build using qt library.
With c4droid you can learn cpp ui using qt and qml.
Try using the aforementioned compiler while you wait for a working PC.

Thanks a lot...in fact I'm already losing inspiration because of non availability of a PC at hand but I'll try to download that straight away and continue with my works.
Re: My C++ CGPA Calculator Program by ibromodzi: 9:19pm On Nov 08, 2017
Nicolars:


FAM, I'm also a beginner ...
Learning both c++ and c# together...
My number: 08117930416

I'm in oop but I'm really having difficulties in understanding the necessity of each techniques; interface,inheritance ,blah blah...

When do you know its time to use this or another...

I think it's normal to get confused whenever you are learning a new concept, it happens to me as well.
We would talk better when the group is ready.
Re: My C++ CGPA Calculator Program by Monoxide(m): 10:14pm On Nov 08, 2017
Hello guys here a link to the cpp whatsapp group https://chatdotwhatsappdotcom/8VPUJGYJ6Eo94O57S9cBgS
change 'dot' to . so that you can access the link.thanks

(1) (Reply)

Survey - People Interested In Artificial Intelligence And Machine Learning / Web Development Using Java / Puzzle of the day

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 102
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.