0% found this document useful (0 votes)
44 views1 page

Problem 1: Assignment #2

The document contains instructions for 3 problems to design pseudocode algorithms. Problem 1 reads 2 numbers and a code, performs math operations based on the code value, and displays errors for invalid codes. Problem 2 reads a starting integer and series of integers, calculates the sum and average excluding the first, and displays the values. Problem 3 reads an inventory file, validates the record code and part number format in each record, and prints details of valid records.

Uploaded by

lim young
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views1 page

Problem 1: Assignment #2

The document contains instructions for 3 problems to design pseudocode algorithms. Problem 1 reads 2 numbers and a code, performs math operations based on the code value, and displays errors for invalid codes. Problem 2 reads a starting integer and series of integers, calculates the sum and average excluding the first, and displays the values. Problem 3 reads an inventory file, validates the record code and part number format in each record, and prints details of valid records.

Uploaded by

lim young
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment #2

Write Down Pseudocode for each following problems.

Problem 1

Design an algorithm that will read two numbers and an integer code from the screen. The value of integer
code should be 1,2,3, or 4. Display an error message if the integer code not equal to 1,2,3, or 4.

- If the value of the code is 1 then calculate sum two numbers


- If the value of the code is 2 then display the smallest value between two numbers
- If the value of the code is 3 then display ‘Nothing to do here’
- If the value of the code is 4 then compute the product of two numbers and check the result
whether odd or even.

Problem 2

Design an algorithm that will read a series of integers at the terminal. The first integer indicates how many
more integers will follow. Your algorithm is to calculate the sum and average of the integers, exclusing the
first integer, and display these values to the screen.

Problem 3

A parts of inventory file contains the following fields:

- Record code (only code 11 is valid)


- Part number (six characters; two alpha and four numeric; for example AA1234)
- Part description
- Inventory balance

Design an algorithm that will read the inventory file and validate record code and part number in each
record and print the details of valid inventory records.

SUBMISSION GUIDELINES:

Due Date : Friday, 5th October 2018 23:55 WIB

Format File : PDF

You might also like