Saturday, 14 September 2013

NO MORE ON BLOGGER

NOTICE


GUYS,
 http://programmingisbest.blogspot.com
is no more all data is automatically transfer to my latest blog

link of new site will be posted soon

stay tuned!!

 
Sorry for the change of link

Regards

Umar Javed
umar@hashmisaf.com

Monday, 10 June 2013

Thank You bloggers

Hi Friends Thank You For seeing my Blog spot programs kindly follow me at twitter for any suggestions


website www.twitter.com/@umarjavedmalik


Kindly write programs Yourself , if You Copy paste my code its Against the Copyrights Laws and plagiarism factorz!!



My another blog Link is :- www.csharpisbest.blogspot.com
is another of mine blog..

Regards

Umar Javed Malik
umarjaved01@gmail.com

Tuesday, 21 May 2013

C++ Subject Grading Policy in University



#include<iostream.h>
void main()
{
int q1,q2,q3,q4,q5,q6; int A1,A2,A3,A4,A5;
int *ptr;
{
    cout<<"\nxxxxQuizzesxxxx";
//best quizzes situation choose best of the 4
cout<<"\nEnter the 5 quizzes marks  = ";
cin>>q1>>q2>>q3>>q4>>q5;
{
    if(q1<q2 && q1<q3 && q1<q4 && q1<q5)
        {
        q6=q2+q3+q4+q5;
        ptr=&q6;
        }
    else if(q2<q1 && q2<q3 && q2<q4 && q2<q5)
        {
        q6=q1+q3+q4+q5;
        ptr=&q6;
        }
    else if(q3<q1 && q3<q2 && q3<q4 && q3<q5)
        {
        q6 = q1+q2+q4+q5;
        ptr = &q6;
        }
  else if(q4<q1 && q4<q2 && q4<q3 && q4<q5)
        {
        q6 = q1+q2+q3+q5;
        ptr = &q6;
        }
  else if(q5<q1 && q5<q2 && q5<q4 && q5<q3)
        {
        q6 = q1+q2+q3+q4;
        ptr = &q6;
        }
 }
    cout<<"\n best of the 4 quizzes marks are as under = "<<q6;
 }
 {

    {
     cout<<"\nxxxxAssignemntsxxxx";
    //best Assignemts situation choose best of the 4
    cout<<"\n\nEnter the 4 Assignments marks are = ";
    cin>>A1>>A2>>A3>>A4;
    {
        if(A1<A2 && A1<A3 && A1<A4)
        {
        A5=A2+A3+A4;
        ptr=&A5;
        }
        else if(A2<A1 && A2<A3 && A2<A4 )
        {
        A5=A1+A3+A4;
        ptr=&A5;
        }
        else if(A3<A1 && A3<A2 && A3<A4)
        {
        A5 = A1+A2+A4;
        ptr = &A5;
        }
        else if(A4<A1 && A4<A2 && A4<A3)
        {
        A5 = A1+A2+A3;
        ptr = &A5;
        }

    }
    cout<<"\n best of the 3 Assignents  marks are as under = "<<A5;
    }

    //to get the 20% weightage
    q6 = (q6/2);

     // to gett the 10% weigtage of the assignments then
     A5 = (A5/3);
    }

    cout<<"\nSo the average best of against the 10% of assignment is  = "<< A5;
    cout<<"\nSo the average best of against the 20% of Quizes is  = "<< q6;

    float mid;
    float final;

    cout<<"\nxxxxMid Teremxxxx";
    cout<<"\nPlease Enter the mid term marks = "; cin>>mid;
    cout<<"\nxxxxFinal Termxxxx";
    cout<<"\nPlease Enter the Final term marks = "; cin>>final;

    cout<<"\nxxxxCalculationsxxxx";
    float totl=A5+q6+mid+final;
    cout<<"\n\nYour Total Marks in subject are as under = "<<totl;

    if(totl>=86 && totl<=100){cout<<"You got A grade";}
    else if(totl>=78 && totl<=85){cout<<"You got B+ grade";}
    else if(totl>=72 && totl<=77){cout<<"You got B grade";}
    else if(totl>=66 && totl<=71){cout<<"You got C+ grade";}
    else if(totl>=60 && totl<=65){cout<<"You got C grade";}
    else if(totl>=50 && totl<=60){cout<<"You got C grade";}
    else if(totl>=0 && totl<=49){cout<<"You are Fail ";}
    else{cout<<"\nWrong marks result error ,try again thnx ";}
}

Sunday, 28 April 2013

c++ program save the string in file and read the string from the file


  1. main()//programmingisbest.blogspot.com
  2. {
  1. char name[15];//programmingisbest.blogspot.com//programmingisbest.blogspot.com
  2. char telephn[10];//programmingisbest.blogspot.com//programmingisbest.blogspot.com
  3. char city[15],opt;
  4. ofstream xyz("nnn.dat");//programmingisbest.blogspot.com
  5. int rec =1;//programmingisbest.blogspot.com
  6. clrscr();
  7. if(!xyz)//programmingisbest.blogspot.com
  8. {
  9.  cout<<"file is not open";
  10.  exit(1);
  11. }
  12. opt='y';
  13. while(opt=='y' || opt=='Y')
  14. {
  15. cout<<"\n Enter the record no # : "<<rec;
  16. cout<<"\n Enter the name of the customer: ";
  17. cin>>name;
  18. cout<<"\n Enter the telephone no of the customer : ";
  19. cin>>telephn;
  20. cout<<"\n enter the city of the customer : ";
  21. cin>>city;
  22. xyz<<name<<"\t"<<telephn<<"\t"<<city<<endl;
  23. rec ++;
  24. cout<<"\n enter more record press (Y/n)";
  25. cin>>opt;
  26. }
  27. }














  1. #include<iostream.h>
  2. #include<fstream.h>
    1. #include<conio.h>
    2. #include<stdlib.h>
    3. main()
    4. {
    5. char name[15];//programmingisbest.blogspot.com
    6. char telephn[10];
    7. char city[15];//programmingisbest.blogspot.com
    8. int rec =1;
    9. ifstream xyz("nnn.dat");
    10. clrscr();//programmingisbest.blogspot.com
    11. if(!xyz)
    12. {
    13.  cout<<"file is not open";
    14.  exit(1);
    15. }
    16. while(xyz)
    17. {
    18. xyz>>name>>telephn>>city;//programmingisbest.blogspot.com
    19. cout<<"\nrecod no is # : "<<rec;//programmingisbest.blogspot.com
    20. cout<<"\nName is : "<<name;//programmingisbest.blogspot.com
    21. cout<<"\ntelephone no is : "<<telephn;
    22. cout<<"nCity is : "<<city;//programmingisbest.blogspot.com
    23. rec++;//programmingisbest.blogspot.com
    24. }
    25. }



Character Write adn Read Program in which character by character Data is saved to the file and then Read from the file in turboo 's bin folder

//program stores characters until escape key is not pressed

#include<iostream.h>
#include<fstream.h>
#include<conio.h>

void main()
{
char ch;
ofstream as("test.txt");
clrscr();
while(ch!=27)
{
ch = getche();
//obj.put(character);
as.put(ch);
if(ch=='\r')
cout<<endl;
}
}

//read character by character data from the file :D
//umarjaved01@gmail.com

#include<iostream.h>
#include<fstream.h>
#include<conio.h>

void main()
{
char ch;
ifstream as("test.txt");
clrscr();
while(as)
{
as.get(ch);
cout<<ch;
}
}