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

  1. 👍 0
  2. 👎 0
  3. 👁 413
  1. as the numbers are accepted, keep track of the smallest. That way there is no need to do a sort later on.

    read least
    WHILE val ne 999 DO
      read val
      sum += val
      least = val if val < least
    print least,sum

    Of course, an array must be used if the list of numbers needs to be retained for some reason.

    1. 👍 0
    2. 👎 0
  2. rats. The above loop will include the terminating 999 in the sum. It is a simple change to stop before including it.

    1. 👍 0
    2. 👎 0
  3. please answer this

    1. 👍 0
    2. 👎 0
  4. an algorithm in pseudo-code that accept 10 students marks and output average mark

    1. 👍 0
    2. 👎 0
  5. Design an algorithm that keeps reading positive numbers until the user enters a zero value, and determines and outputs the largest number

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions


    Write an algorithm and flowchart that will accept score of 30 student in a class calculate and print the average mark in basic program.

    asked by Musa Bilya on April 26, 2016
  2. Pseudocode

    Write an algorithm and pseudocode for A salesperson wants to write a program to calculate their gross monthly pay based on their annual salary, total sales, and commission rate. The program's output is the monthly pay calculated

    asked by Mare on October 28, 2018
  3. Programming concepts

    Develop a menu-driven program that inputs two numbers and, at the user’s option, finds their sum, difference, product, or quotient. top-down modular approach and pseudocode to design a suitable program to solve it. I am having

    asked by Aaron on August 1, 2014
  4. programming

    1. Write a structured algorithm that prompts the user to input two numbers. The algorithm should calculate and print the sum & product of the two numbers [21/2]

    asked by alethia benney on October 16, 2012
  5. C++

    // Program: name of program // Author: your name // Date Written: date you began writing the program /* Abstract: Brief description of the program */ Include in-line comments in the body of your program. You can convert

    asked by Frank on September 23, 2016
  1. pseudo code algorithm

    Write a pseudo code algorithm which: • Determines the average weight of a person over a particular year. • For each month, your algorithm should input the person's weight for that month (a positive real number). Your algorithm

    asked by husanpreet on April 27, 2016
  2. Computer

    Write an algorithm and flow chat to print the first ten even numbers

    asked by Tiwa on July 7, 2020
  3. programming

    Example Develop a pseudocode algorithm for a program that accepts each of the average marks of 10 students in a class and computes the sum and the average mark of the class. The program should display the average mark of the

    asked by yvonne on June 27, 2016
  4. 8th Grade Math

    Write an equation and show all work. The sum of three consecutive odd numbers is 111. What is the smallest of the three numbers? (I don't understand the question >.

    asked by Cassidy on September 22, 2013
  5. Algebra

    A survey about the student government program at a school finds the following results: 190 students like the program 135 students think the program is unnecessary 220 students plan on running for student government next year. If a

    asked by Chara on March 12, 2019
  6. Programming and Design

    Draw the hierarchy chart and design the logic for a program that calculates the projected cost of an automobile trip. Assume that the user's car travels 20 miles per gallon of gas. Design a program that prompts the user for a

    asked by Matt on April 3, 2013

You can view more similar questions or ask a new question.