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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Bear Bibeault
• Ron McLeod
• Jeanne Boyarsky
• Paul Clapham
Sheriffs:
• Tim Cooke
• Liutauras Vilda
• Junilu Lacar
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• fred rosenberger
• salvin francis
Bartenders:
• Piet Souris
• Frits Walraven
• Carey Brown

# Java code help!!!!

Greenhorn
Posts: 7
I’m completely stumped on this one???
The process of finding the largest value (i.e., the maximum of a group of values) is used frequently in computer applications. For example, a program that determines the winner of a sales contest would input the number of units sold by each salesperson. The sales person who sells the most units wins the contest. Write a pseudocode program and then a java application that inputs a series of 10 single-digit numbers as characters, and determines and prints the largest of the numbers.{Hint: Your program should use three variables as follows:
counter:A counter to count to 10 (i.e., to keep track of how many numbers have been input, and determine when all 10 numbers have been processed)

number:The current digit input to the program

largest:The largest number found so far.]

Ranch Hand
Posts: 3244
What do you have on it so far? Where are you stumped? People here will not just give you the solution to your homework, you wont learn anything that way.

Ranch Hand
Posts: 704
This is a classic homework question. It is to test your understanding of sorting alogorithms. The easiest way to solve the problem �s with a bubble sort. Do some searching on the net and you will find the answer. But make sure you understand how the alogorithm works !!! If you learn something, learn it throughly

Sheriff
Posts: 7023
Basic question(s):
If you were to to this without any computer program, how would you do it?
Someone hands you ten pieces of paper with numbers on them. How do you determine which piece of paper has the largest number?

mister krabs
Posts: 13974
He doesn't need a bubble sort. Since the numbers are coming in from the input stream he can just compare to see if current is greater than largest as they come in.

Nigel Browne
Ranch Hand
Posts: 704
Thomas that is only true if he doesn't need to persist the inputs

Ranch Hand
Posts: 2823
Read his instructions. He doesn't need a sort.

Nigel Browne
Ranch Hand
Posts: 704
I stand corrected.

Ranch Hand
Posts: 32
Chad: As the others have said, think about how you would do it in real life. Getting handed pieces of paper one at a time and you have to figure out what the biggest one is by the end.
Post what you have and you will get tons of help but until then that is all that most of us would be willing to tell you about a homework problem.

 Is this the real life? Is this just fantasy? Is this a tiny ad? Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton