Asked by Anonymous
                Write an algorithm for a program that accepts a set of numbers
and finds the smallest among them and computes the sum of
the numbers accepted. The program stops when the user
enters number 999. Convert the algorithm into flowchart
            
        and finds the smallest among them and computes the sum of
the numbers accepted. The program stops when the user
enters number 999. Convert the algorithm into flowchart
Answers
                    Answered by
            Steve
            
    as the numbers are accepted, keep track of the smallest. That way there is no need to do a sort later on.
read least
sum=least
val=least
WHILE val ne 999 DO
read val
sum += val
least = val if val < least
DONE
print least,sum
Of course, an array must be used if the list of numbers needs to be retained for some reason.
    
read least
sum=least
val=least
WHILE val ne 999 DO
read val
sum += val
least = val if val < least
DONE
print least,sum
Of course, an array must be used if the list of numbers needs to be retained for some reason.
                    Answered by
            Steve
            
    rats. The above loop will include the terminating 999 in the sum. It is a simple change to stop before including it.
    
                    Answered by
            bam
            
    please answer this
    
                    Answered by
            allan
            
    an algorithm in pseudo-code that accept 10 students marks and output average mark
    
                    Answered by
            tesfit
            
    Design an algorithm that keeps reading positive numbers until the user enters a zero value, and determines and outputs the largest number
    
                                                    There are no AI answers yet. The ability to request AI answers is coming soon!
                                            
                Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.