Dear all,
I have a program to code which would take several lines of input from user (a fruit name, it's price per kg and the number of kgs sold). Each seperated by a space. It would then output the total money made and the name of the fruit that made maximum sales. And, it would use sentinel "Stop" to halt the program.
Now, I know this is fairly easy to write. But, I have never used strings and I don't know where to begin. Hints?
SMYussef
0
Newbie Poster
Recommended Answers
Jump to Postactually, I would write it a bit like this:
nameFruit = input.next(); while (!nameFruit.equalsIgnoreCase("Stop")){ // read price and sold // add code to handle information nameFruit = input.next(); }
for more precise answers, you may want to clarify your question a bit further.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.