• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with order of output

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.. Ok I have another class file that this method is being called from. Everything compiles fine. There are two problems however.

Firstly, the output comes out in the wrong order. I need it to be High Risk, Medium Risk, then Low Risk. Also, there is a tenth person who just doesn't show up! The array in which she exists is perfect and I see absolutely no reason she should be in this list. She is the first in all of the arrays, which may or may not have anything to do with the problem. Thanks for any help..

OUTPUT
Patients with a Low Health Risk
Sue James... Weight: 54.47736Kg - Height: 1.651m - BMI: 19.99 - Age: 27
Bruce Gray... Weight: 60.51024Kg - Height: 1.5748m - BMI: 24.4 - Age: 59
Janet Parker... Weight: 66.906Kg - Height: 1.8288m - BMI: 20 - Age: 69
Stan Terrance... Weight: 68.99256Kg - Height: 1.7018m - BMI: 23.82 - Age: 79
Moe Greary... Weight: 74.07288000000001Kg - Height: 1.7526m - BMI: 24.12 - Age: 41
Kerry Robson... Weight: 77.15736Kg - Height: 1.8034m - BMI: 23.72 - Age: 55

Patients with a High Health Risk
Larry Ovid... Weight: 84.55104Kg - Height: 1.778m - BMI: 26.75 - Age: 63

Patients with a Medium Health Risk
Paul Dresser... Weight: 90.35712Kg - Height: 1.8796m - BMI: 25.58 - Age: 57
Ethan Rome... Weight: 99.792Kg - Height: 1.7526m - BMI: 32.49 - Age: 46



CODE
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing in your code that does anything with ordering. In fact, if it is unordered, you headings printouts will be wrong.

I am assuming that the ordering is done elsewhere. That is probably a good place to look.

Henry
 
Your mind is under my control .... your will is now mine .... read this tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic