hi….

This topic contains 8 replies, has 2 voices, and was last updated by  GWILouisaxwzkla 8 years, 2 months ago.

  • Author
    Posts
  • #2191

    MerissaQxm
    Member

    i’m new c++….and i have jus started learnin …i’m a beginnner….
    so cud sum1 pls correct dis code….and suggest sum changes….so dat it calculates da bill even if da items r bought at random…?(…..coz now it only calculates da bill if da items r bought in an order…)

  • #3555

    could you post your source code?

  • #3556

    MerissaQxm
    Member

    i know dis is da wrong way 2 b doin da program….but i’m jus a beginner….so dis is da best i cud think of….and i seriously need all da help dat i can get….plsssssssssssssss…..

  • #3557

    heres a start ( I’m not certain why you are dividing every purchase in the program by 1000 ) . By the way don’t use “gotos” in high level programming languages , this is considered bad programming practice ( google Dijkstra ). Anyway , this is how I might code what you have ( the total comes out 0 since everything is divided by 1000 ). Anyway……..

  • #3558

    oops. try this version with total as a double :

  • #3559

    MerissaQxm
    Member

    i divide dem all wid 1000…coz….its like….I USED DA FOLLOWIN LOGIC…
    for 1000g –> it costs Rs.100.00
    so for xg –>it should cost Rs. (100*x)/1000
    SO…must i not divide it by 1000…..?

  • #3560

    yeah , that makes sence :) .

  • #3561

    MerissaQxm
    Member

    :)
    so….da program WILL give me da expected result…..rite…?

  • #3562

    If your original calculations are correct it should be fine. You’ll need to test the program thought…….

You must be logged in to reply to this topic.