SECJ1013-10 Programming Technique 1

Assignment 1

The program will determine the winner of a sales contest. The salesperson who sold the most
units wins the contest. There are 19 salespersons in this contest. Read the salesperson ID number
and the number of units sold by each salesperson. Determine and display the winner of the
contest. If the winner sold more than or equal to1000 units, display “excellent”. If less than 1000
but greater than 749 units, display “very good”, otherwise display “good”.

Pseudocode

Pseudocode

  1. Start
  2. Set sales=0,highest=0,counter=0,winner=0
  3. while (counter<=18)
    • ReadID,sales

         3.2. if (sales>highest)

            3.2.1 highest=sales

            3.2.2 winner=ID

         3.2.3 End_if

         3.3 counter=counter+1

  1. End_while
  2. Print highest, winner
  3. if (highest>=1000)

             6.1 Print “excellent”

           6.2 else if (highest>749)

             6.2.1 Print “very good”

           6.3 else

             6.3.1 Print “good”

  1. End_if
  2. End

 

 

 

Flowchart