Posts

inheritance in cpp

Image
Hello From Iqbal; welcome to My Blog;in the program below i am going to use famous Object Oriented Programming Properties i.e.   Inheritance ,   Encapsulation     Method Overriding feel free to comment if you have any question(s). #include <iostream> using namespace std; class Person{    // person class , the base class from whihc further classes will inherit private : // encapsulated private members(data fields) string profession; int age; public: Person(){ } void setAge(int a){    //setters ( mutators) this->age=a; } void setProfession(string prof){ this->profession = prof; } int getAge()  {  //getters (accessors) return age; } string getProfession()  { return profession; } void display(){ cout<<"my Profession is"<<profession<<"\n"; cout<<"my age is: "<<age<<"\n"; walk(); talk(); }  v

Digital Khaata Privacy Policy

Privacy Policy Iqbal Ahmad built the Digital Khaata app as a Free app. This SERVICE is provided by Iqbal Ahmad at no cost and is intended for use as is. This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Digital Khaata unless otherwise defined in this Privacy Policy. Information Collection and Use For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to

CS201-VU- Multi Diemensional arrays in cpp with do while loop

Hello guys!  The following cpp program demonstrates the use of  two dimensional Arrays and do while loop;  comment below for any queries. #include <iostream> #include <stdlib.h> using namespace std; void showElements(float cov19data[][4]);  // functions definitions  double percentageDeath(float cov19data[][4], int userChoice); double percentageRecovered(float cov19data[][4], int userChoice); int main() { int selectedOption; float cov19data[7][4]   // defining two diemensional array { { 0, 560433, 22115, 32634}, { 1, 156363, 19899, 34211},  { 2, 84279, 10612, 0}, { 3, 82160, 3341, 77663}, { 4, 71686, 4474, 43894}, { 5, 56956, 1198, 3446}, { 6, 5374, 93, 1095} }; do {  // do while loop to run program untill user terminates it. showElements(cov19data);   // function call cout << "\n\n"; cout << "Press The Country Code To Calculate Percentage Of Dead And Recovered Persons\n\n

switch-statement-in-cpp

Hi folks welcome to iTech Apps Lab Blog This C++ program Demonstrates the use of Switch Statement Scenario: Calculating salary increment and Tax amount for different Initial Scales #include <iostream> using namespace std; main() { //delare and initialize the variables int sp_scale=0; int init_sal=0; int increment_amnt=0; int updated_sal=0; int tax_amount=0; int net_Salary=0; //showing menu on console cout<<"************* SALARY CALCULATOR ***************"<<endl; cout<<"\nSelect a pay scale from the menue : "<<endl; cout<<"\n************* ***************** ***************"<<endl; cout<<"\n************* Enter 1 for SPS6  ***************"<<endl; cout<<"\n************* Enter 2 for SPS7  ***************"<<endl; cout<<"\n************* Enter 3 for SPS8  ***************"<<endl; cout<<"\n************* Ent

INSTALLING WINDOWS FROM A USB

Image
hello from IQBAL guys some times we need to install windows but we don not have CD-ROM in our laptop to insert the disc or our CD-ROM is out of work. we need not to worry about this as we have an alternate way of installing windows. GO THROUGH THE FOLLOWING STEPS: 1) first we  need to find .iso file of the windows we want to install. if you have a window disc, you can get .iso file from it using BURN AWARE  Software tool. or you can search the .iso file on internet and download it. 2) we need to create a bootable usb using POWER ISO software. 3) enter BIOS set up  of the laptop, goto Boot Order and Select USB first. 4)now insert the USB into your laptop and restart it. it will prompt you to "press any key to  boot..." 5) go ahead and install the windows as you do... good luck. if you still need further guidance , feel free to ask in comments.

complete example creating , updating and deleting a text file in C++

Hello From IQBAL , guys, we often come across situations to store little data in .txt file. in the code below i have covered:  creating txt file to store records of employees showing records from the file(reading file) updating salary of the employee(updating specific text in the file) deleting old file when program runs. An Employee Class with needed Methods your comments and suggestions are welcomed #include <iostream> #include <string> #include <fstream> #include <streambuf> #include <bits/stdc++.h>  using namespace std; class Employee{ public:   void add(string code,string name,int salary) {   cout<<"Employee: "<<name<<" with Salary :"<<salary<<" Addedd."; ofstream file;   file.open ("employee.txt",std::ios_base::app);   file <<code<<","<<name<<","<<salary<<";";  

printing Alphabets in a shape like diamond inside a square using C++

Image
Hello From IQBAL ! guys, after tiresome work i have produced the following code to print alphabets like below:   Below is the source code, feel free to comment your suggestions and corrections. #include <iostream> using namespace std; int main(void){     int a= 65;     char height = 'G'; // can get this as input via cin>>     int endchar = (int) height;     int rows, c, k;          rows =endchar-a-1; int steps = rows;     for (k=1; k<=rows+1; k++)     {      for(c=0; c<=steps; c++)     {     cout<<((char)(65+c));     }         for(c=1; c<=(2*k-2); c++)     {     cout<<" ";     }     if(k==1){         for(c=1; c<=rows; c++) {     cout<<((char)(endchar-c-1));     }     } else{     for(c=steps+1; c>0; c--)     {     cout<<((char)(a+c-1));     }     }     steps--;     cout<<"\n";         } //upper part ends here     //starts lower part