• 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

case statement, import file, output file

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, to run a program, I must include text file.
When I run, I must keep my files running from the text file.

Here is the text file.


a 54 AB123 Orange Pte Ltd
A 100 CD456 Apple Pte Ltd
A 153 EF778 XYZ Pte Ltd
a 2415 GH123 Mango Pte Ltd
B 14 IJ456 Xin Yin Pte Ltd
B 20 KL789 Mangnolia Pte Ltd
b 110 MN123 Fresh Mango Pte Ltd
b 117 OP456 Kiwi Pte Ltd
B 6 XT123 Banana Pte Ltd

There are 100kg, 20kg, 10kg and 5kg provided.

(Note that: 'A' or 'a' cannot accept 100 kg)
(Note that: 'B' or 'b' cannot accept 100 kg and 20 kg)

and coding.




the output must be in terms of this:


EXCELLENT FERTILIZER WHOLESALER SDN BHD
WEEKLY ORDER REPORT

_________________________________________________________________________________________________________________
RETAILER YZ123 SUPREME EXCELLENT PTE LTD
_________________________________________________________________________________________________________________

ORDER: 10 KG

10 KG SACKS 1

TOTAL NUMBER OF SACKS: 1

ORDER SHORT BY: 0 KG

INVOICE: $11.70




_________________________________________________________________________________________________________________
SUMMARY
_________________________________________________________________________________________________________________

1 ORDERS PROCESSED

10 KG SACKS 1

TOTAL NUMBER OF SACKS: 1

ORDER SHORT BY: 0 KG

TOTAL AMOUNT INVOICED: $11.70



the case A is still not working. thus cannot run :/
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "not working"?
 
Lily Zulkipli
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i try to run, but the program is not working. so i guess there's must be something wrong with my case statement perhaps?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, what do you mean by "not working"? Do you mean that your computer blue-screens? That clicking the Run button (or menu item) does absolutely nothing at all? Or that Eclipse crashes? Or do you mean that the app runs but you get an exception? Or do you mean that the app runs but you don't get the results you though you would get? Or is it something else? Please tell us the exact behavior you are seeing when you attempt to run the app.
 
Lily Zulkipli
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"or do you mean that the app runs but you get an exception?"

"do you mean that the app runs but you don't get the results you though you would get"

yes i was talking about these part, i was wondering what my mistakes are in the coding. sigh
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are getting an exception, post the exception stack trace.

If the app is not behaving as you expect, tell us exactly what the app is doing, and what it should be doing instead. In other words, tell us what you want the app to do (be very specific), and then tell use what the app is doing 9once again, be very specific)

Bottom line: we cannot help you if you do not TellTheDetails
 
My cellmate was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic