cod problem

Discussion in 'Programmer's Corner' started by TAKYMOUNIR, Oct 11, 2012.

  1. TAKYMOUNIR

    Thread Starter Active Member

    Jun 23, 2008
    351
    1
    this program should converter gas price from canadian price per liter to usa price per gallon and i should enter series of prices(canadian prices) and there is termination for the loop when t=0 ,the program is run but the logic of program is wrong can someone please run the code and check where is the problem
    thanks
     
    • p2.txt
      File size:
      1.2 KB
      Views:
      20
    Last edited: Oct 11, 2012
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Please have the courtesy to at least tell what is wrong with the program. And what you have done to sort this out. Like have you done any debugging?
     
    TAKYMOUNIR likes this.
  3. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    I remember in the old days, learning Turbo Pascal...

    This was a classic assignment. Convert something, calculate, and loop until input == 0

    Gas prices pr litre/gallon and the same with Celcius/Fahrenheit.


    Is this homework?

    I actually read this post due to the title "cod problem" - Thought it had something to to with COD, or Call of Duty. My bad.
     
    TAKYMOUNIR likes this.
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I do not know much about the Call of Duty. But I know a thing or two about fishing cod:p
     
    TAKYMOUNIR likes this.
  5. TAKYMOUNIR

    Thread Starter Active Member

    Jun 23, 2008
    351
    1
    thank youi did fix it
     
  6. TAKYMOUNIR

    Thread Starter Active Member

    Jun 23, 2008
    351
    1
    thank
    the cod work ok but i like the result to be like this
    canadian price per liter rate usa price per gallon
    ---------------------------------------------------------------
    xx xx xx
    xx xx xx
    xx xx xx
    ..
    ..
    ..
    and the code stop execution or the loop terminate when t=0
    can you please help me to make the result look like this
    thanks
     
  7. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    Do you mean the horizontal tab \t?. Is that what you are looking for?
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I might be on a (cod) fishing trip here(pun intended) But perhaps the op want to key in all the values until a zero is typed in. Then print out a list. In order to do that. The input values must be stored in an array and processed then a zero is typed in. Maybe this can help http://www.thegeekstuff.com/2011/12/c-arrays/
     
    TAKYMOUNIR likes this.
Loading...