Results 1 to 8 of 8

Those who can, plz Help me in c++

This is a discussion on Those who can, plz Help me in c++ within the C++ forums, part of the Courses category; Friends mai nai ye program likha hai. jo kisi store k customer k lye uskay purchasing items ki total cost ...

  1. #1
    Senior Student Adnan Ahmad Khan's Avatar
    Join Date
    Aug 2010
    Location
    Bannu/Pakisatn
    Age
    27
    Posts
    261

    Drool Those who can, plz Help me in c++

    Friends mai nai ye program likha hai.
    jo kisi store k customer k lye uskay purchasing items ki total cost maloom krnay k mai store keeper ki madad kray ga.
    Leken masla ye hai K
    screen pr promps 2 guna aathay hai (agr types of item 2 ho tho wo 4 mrtba entry k lye kehta hai) leken result teek deta hai.
    So plz help me

    #include<iostream.h>
    #include<conio.h>
    int sum (int itemtypes);
    main()
    {
    int itemtypes;
    int Total=0;
    cout<<"How many types of items are there ? ";
    cin>>itemtypes;

    for (int b=1; b<=itemtypes; b++)
    {
    sum (itemtypes);
    Total+= sum(itemtypes);

    }
    cout<<"The Total cost is "<<Total;
    getch();
    return 0;
    }
    int sum (int itemtypes)
    {
    int itemprice,itemquatity,total;
    cout<<"Enter price of item. ";
    cin>>itemprice;
    cout<<"Enter Total numbers of that item. ";
    cin>>itemquatity;
    total=itemprice*itemquatity;
    return total;
    }


  2. #2
    Senior Student Adnan Ahmad Khan's Avatar
    Join Date
    Aug 2010
    Location
    Bannu/Pakisatn
    Age
    27
    Posts
    261

    Re: Those who can, plz Help me in c++

    No one to help me??????????

    I can help my self.

    Apni madad aap k takht mai nai es program ko correct kr liya hai...

    here you can check it now

    #include<iostream.h>
    #include<conio.h>
    int sum ( int itemprice,int itemquatity);
    main()
    {
    int itemtypes;
    int Total=0;
    cout<<"How many types of items are there ? ";
    cin>>itemtypes;
    for (int b=1; b<=itemtypes; b++)
    {
    int itemprice,itemquantity;
    cout<<"Enter price of item. ";
    cin>>itemprice;
    cout<<"Enter Total numbers of that item. ";
    cin>>itemquantity;
    sum (itemprice,itemquantity);
    Total+= sum(itemprice,itemquantity);
    }
    cout<<"The Total cost is "<<Total;
    getch();
    return 0;
    }
    int sum ( int itemprice, int itemquantity)
    {
    int total;
    total=itemprice*itemquantity;
    return total;
    }

  3. #3
    iTT Student
    Join Date
    May 2011
    Location
    pakistan
    Posts
    54

    Re: Those who can, plz Help me in c++

    Quote Originally Posted by Adnan Ahmad Khan View Post
    Friends mai nai ye program likha hai.
    jo kisi store k customer k lye uskay purchasing items ki total cost maloom krnay k mai store keeper ki madad kray ga.
    Leken masla ye hai K
    screen pr promps 2 guna aathay hai (agr types of item 2 ho tho wo 4 mrtba entry k lye kehta hai) leken result teek deta hai.
    So plz help me

    #include<iostream.h>
    #include<conio.h>
    int sum (int itemtypes);
    main()
    {
    int itemtypes;
    int Total=0;
    cout<<"How many types of items are there ? ";
    cin>>itemtypes;
    for (int b=1; b<=itemtypes; b++)
    {
    sum (itemtypes);
    Total+= sum(itemtypes);
    }
    cout<<"The Total cost is "<<Total;
    getch();
    return 0;
    }
    int sum (int itemtypes)
    {
    int itemprice,itemquatity,total;
    cout<<"Enter price of item. ";
    cin>>itemprice;
    cout<<"Enter Total numbers of that item. ";
    cin>>itemquatity;
    total=itemprice*itemquatity;
    return total;
    }
    #include<iostream.h>
    #include<conio.h>
    int sum (int itemtypes);
    main()
    {
    int itemtypes;
    int Total;
    cout<<"How many types of items are there ? ";
    cin>>itemtypes;

    Total=sum (itemtypes);

    cout<<"The Total cost is "<<Total;
    return 0;
    }
    int sum (int itemtypes)
    {
    int i,itemprice,itemquatity,total=0,price;
    for(i=1;i<=itemtypes;i++)
    {cout<<"Enter price of item. ";
    cin>>itemprice;
    cout<<"Enter Total numbers of that item. ";
    cin>>itemquatity;
    price=itemprice*itemquatity;
    total+=price;
    }
    return (total);
    }
    hi it fireocean ...
    is programe ma ap na ya ghalti ki thi k for loop ko function ma nai chala ya . jis ki wja se tmay char vaue danay partha thay ... or koi masslah ho tho plzzz tell donot hesitate ....bye see

  4. #4
    iTT Student
    Join Date
    May 2011
    Location
    pakistan
    Posts
    54

    Re: Those who can, plz Help me in c++

    #include<iostream.h>
    #include<conio.h>
    int sum (int itemtypes);
    main()
    {
    int itemtypes;
    int Total;
    cout<<"How many types of items are there ? ";
    cin>>itemtypes;

    Total=sum (itemtypes);

    cout<<"The Total cost is "<<Total;
    return 0;
    }
    int sum (int itemtypes)
    {
    int i,itemprice,itemquatity,total=0,price;
    for(i=1;i<=itemtypes;i++)
    {cout<<"Enter price of item. ";
    cin>>itemprice;
    cout<<"Enter Total numbers of that item. ";
    cin>>itemquatity;
    price=itemprice*itemquatity;
    total+=price;
    }
    return (total);
    }
    hi it fireocean ...
    is programe ma ap na ya ghalti ki thi k for loop ko function ma nai chala ya . jis ki wja se tmay char vaue danay partha thay ... or koi masslah ho tho plzzz tell donot hesitate ....bye see

  5. #5
    Senior Student Adnan Ahmad Khan's Avatar
    Join Date
    Aug 2010
    Location
    Bannu/Pakisatn
    Age
    27
    Posts
    261

    Re: Those who can, plz Help me in c++

    Quote Originally Posted by fireocean View Post
    #include<iostream.h>
    #include<conio.h>
    int sum (int itemtypes);
    main()
    {
    int itemtypes;
    int Total;
    cout<<"How many types of items are there ? ";
    cin>>itemtypes;

    Total=sum (itemtypes);

    cout<<"The Total cost is "<<Total;
    return 0;
    }
    int sum (int itemtypes)
    {
    int i,itemprice,itemquatity,total=0,price;
    for(i=1;i<=itemtypes;i++)
    {cout<<"Enter price of item. ";
    cin>>itemprice;
    cout<<"Enter Total numbers of that item. ";
    cin>>itemquatity;
    price=itemprice*itemquatity;
    total+=price;
    }
    return (total);
    }
    hi it fireocean ...
    is programe ma ap na ya ghalti ki thi k for loop ko function ma nai chala ya . jis ki wja se tmay char vaue danay partha thay ... or koi masslah ho tho plzzz tell donot hesitate ....bye see
    THanks LEKEN wo tho mai nay teek kr lya tha..... AOOPAR DEK lO.... HA HA HA.... Koi baat ni...... Bye... see you again.....
    If you want to be alive forever, Then DIE for others...

  6. #6
    iTT Student
    Join Date
    May 2011
    Location
    pakistan
    Posts
    54

    Re: Those who can, plz Help me in c++

    ha yar mai na nahi daka tha ... yar tm meray lia 1 programe tho banao ma na last ma post ki ... posts ma dako... thanks for ur reply........... friend ... yar ya usa ma jo you-people university ha is k baray ma kuch janthay ho k nai.
    As rule man is fool;
    When its hot he wants it cool;
    when its cool ;
    he wants it hot ;
    always wanting what is not ;

  7. #7
    Senior Student Adnan Ahmad Khan's Avatar
    Join Date
    Aug 2010
    Location
    Bannu/Pakisatn
    Age
    27
    Posts
    261

    Re: Those who can, plz Help me in c++

    Quote Originally Posted by fireocean View Post
    ha yar mai na nahi daka tha ... yar tm meray lia 1 programe tho banao ma na last ma post ki ... posts ma dako... thanks for ur reply........... friend ... yar ya usa ma jo you-people university ha is k baray ma kuch janthay ho k nai.

    yr wo prgram tho mai nay POSt Krdya hai....
    If you want to be alive forever, Then DIE for others...

  8. #8
    iTT Student
    Join Date
    Sep 2012
    Location
    Peshawar/Pakistan
    Posts
    14

    Re: Those who can, plz Help me in c++

    agar ye aap classes aor funtions k through karthe tho phir bohot asani se ho jatha.......

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •