posted by Jackie on .
how do I write a pseudocode to find and display the largest list of positive numbers entered by the user. The user should indicate that he/she has finished entering numbers by enter a
A pseudocode is nothing but a program written in an imaginary programming language that resembles English (or any other spoken language) so that the way and the steps to solve the problem can be made evident.
The way and the steps to solve a problem, when "translated" to English, is an algorithm.
The question requires you to solve the problem by stating the steps you will need to do to achieve the desired result.
You can start by stating the method/steps/procedure in English.
The exact wording of the question makes a big difference to the solution.
"...to find and display the largest list of positive numbers entered by the user."
is not very clear.
A list usually has two or more elements. It is not stated how many are needed on the list, e.g. top 10, top 3, etc.
It could also mean to sort the complete list entered by the user into a descending sequence.
If there was a typo, it could simply be looking for the largest number among those entered.
Since the question specified positive numbers, your method/algorithm should check that the entered number is a positive integer, i.e. exclude zeroes and negative numbers. If not, an error or warning message should be issued, and the program should terminate or have the user re-enter accordingly.
The above presents some guides. You'd need to check for typos in the question. If there were none, you could check with your teacher what the proper interpretation is.
2. A public light utitlity company bills a unit of electricity usage in KWH. In its new billing policy, domestic usage, Rate 15, will have a monthly rate of $ 12.20 per unit for the first 100 KWH; $ 18.25 per unit for the next 700 KWH and $ 42.10 per unit for the each additional units. In the case of Commercial usage, Rate 20, the JPSCo will bill all units at $ 31.50. The billing manager is given the amount of electricity units (in KWH) used by a customer along with his rate category (ie 15 or 20). A program is needed to calculate the amount of money due to be paid by the customer and to generate a bill statement. A GCT of 18% is added to the final amount of all bills. Develop the psuedocode program for same