04/08/2021
What programming language should I learn first🤔?, probably the most asked questions by beginners who what to get their hands on programming. According to google there about 700 programming languages, now that sounds like a lot of fish in the sea to choose from😂😂😂😂😂, just kidding.
So the following are some of the things you need to put into consideration when choosing a programming language to learn first. Are you learning programming to get a job🧑🏾💻 well if that’s it well you then have to choose amongst the following just to mention a few of the current highest paid programming languages: Go, Scala, CoffeeScript, R, TypeScript, SQL, JAVA, Python, javaScript and C++. Else if you are learning programming to build something like an e-commerce website, mobile app of your dreams , create a game or programme an Arduino🧑🏾💻🧑🏾💻 the you need to ask uncle google on languages that you need to learn to do that, but just to give you a hint incase you want to build an android app, you can start with kotlin. Else if you are learning programming just you know as a hobby just like me🧑🏾💻🧑🏾💻🧑🏾💻 , you are free to start with anything that catches you at first sight, just like I fell involve with C++ at first site. In conclusion I would advise that you first find the purpose as to why you want learn programming that will make it easy for you to choose a programming language to learn first and don’t forget to make use of uncle google when you have questions😂😂😂😂.
13/03/2021
Come and learn to code with us
February 9, 2021
10/01/2021
Join our WhatsApp group 😌😌
WhatsApp Group Invite
WhatsApp Group Invite
20/12/2020
Hello world
Thanks for staying glued to our page we are planning something big ,be on look out😊
22/10/2020
Day 28 of 50daysofC++ code challenge
Classes and Objects.
A class in C++ is a building block that leads to Object-Oriented-Programming.
Accessing data members.
Access modifiers are used to implement an important feature of object-oriented-programming known as data hiding. Let’s consider a real-life example:
The Zambian secret informatic system which has five senior members have some top secret regarding national security. So, lets think of the five people as class data members. People who are not part of this system or class cant access information direct without being permitted to, this is what data hiding is.
There are three types of access modifiers
public
private
protected
public: all class members declared under public will be available to anyone.
Example:
using namespace std;
//declaring a class
class Person
{
public:
string food=”nsima”;
int age=20;
void eating()
{
cout
20/10/2020
Day 27 of 50daysofC++ code challenge
OOP in C++
What is OOP?
OOP stands for object-oriented programing.
So far we have looked at structure and procedural programming. OOP is about crating objects that contain both data and functions. OOP uses objects and classes and is based on real entities like inheritance, polymorphism, data hiding.
ADVANTAGES OF USING OOP
OOP is faster and easier to execute.
OOP provides a clear structure for programs
OOP makes code easier to modify and debug.
OOP makes it possible to create reusable application with less code.
19/10/2020
Day 26 of 50daysofC++ code challenge.
Classes in C++
A class is a collection of data members and member functions, data members are variables inside class while member functions are functions inside a class. It is also called user defined data type.
Points to consider when creating a class
Declare variable with appropriate data type.
Declare function as of given task.
Create an instance (object) of the class to access data member and member function of a class, for example classname objectname.
use dot operator to access data members and member functions.
An object has state and behavior, where state means what it has and behavior what it does. For example a pen has , state: Ink, nib, behavior: writting
Syntax of a class
class Classname
{
Access specifier(private, public, protected
Data member 1
Member function 1
};
Example
using namespace std;
//declaring a class
class Person
{
public:
string food=”nsima”;
int age=20;
void eating()
{
cout
17/10/2020
Day 24 of 50daysofC++ code challenge
Union in C++
It is a user defined in which all members share the same memory location, the size of the union is determined by the largest member of the union. Unlike structures only one field is used at a given time. It doesn’t allow multiple values simultaneously. It can only store one value at a time.
Syntax
union union_name
{
//datatypes
}union_variable;
Example
using namespace std;
union student
{
float mark;
int age;
};
int main()
{ student student1;//declaring variable for union
student1.age=45;
student1.mark=71.9;
cout
16/10/2020
Day 23 of 50daysofC++ code challenge
Nested structures in C++
A nested structure is a structure in another structures. To nest a structure inside of another structure we have to declare the nested structure before the structure its being nested in .
Syntax
struct nested_structure_name
{
//datatypes
};
struct name_for_nesting_structure
{
//datatypes
struct nested_structure_name variable_name_for_nested_structure;
}structure’s_variable;
For example
using namespace std;
struct address
{
string city="lusaka";
string houseno= "124/96";
};
struct student
{
string name="DOREEN";
int mark=60;
struct address address1;
}student1;
int main ()
{
cout
15/10/2020
Day 22 of 50daysofC++ code challenge
Structures
A structure is a collection of data of different type, It is user defined datatype. The data can be of any data type for example int, float. We can access a member of a structure by making the variable of the structure. We use the struct key word to create a structure.
Syntax
struct structure_name
{
data_type variable1;
data_type variable2;
};
The following are some examples of creating a structure and its variable.
Example 1
struct student
{
string name;
float marks;
};
Here the structures name is student.
Now lets create a variable for a structure using method 1
using namespace std;
struct student
{
string name;
float marks;
};
int main ()
{
struct student student1;
return 0;
}
In the above code student1 is the variable of a structure.
Declaration of structure variable method 2
using namespace std;
struct student
{
string name;
float marks;
}student1;
int main ()
{
return 0;
}
Accessing the data members of a structure
To access the data member of a structure we use this syntax, structure_variable.data_member.
using namespace std;
struct student
{
string name=”Doreen”;
float marks=50;
}student1;
int main ()
{
cout