0% found this document useful (0 votes)
4 views4 pages

As Pseudocode Practise Set 3

The document outlines a series of programming tasks involving data structures and algorithms, divided into five main questions. Each question focuses on different applications such as student analytics, warehouse inventory tracking, weather data processing, transaction processing, and matrix analysis. The tasks include inputting data, performing calculations, and generating reports based on the processed information.
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)
4 views4 pages

As Pseudocode Practise Set 3

The document outlines a series of programming tasks involving data structures and algorithms, divided into five main questions. Each question focuses on different applications such as student analytics, warehouse inventory tracking, weather data processing, transaction processing, and matrix analysis. The tasks include inputting data, performing calculations, and generating reports based on the processed information.
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/ 4

AS PSEUDOCODE SET 3

Question 1: Student Analytics System

Part A:
Declare a 6x5 integer array Scores to hold marks for 6 students in 5 subjects and a parallel array Names
for their names. Input all data.

Part B:
For each student:

• Calculate total, average, and percentage.

• Assign a letter grade:

o "A": percentage ≥ 85

o "B": percentage ≥ 70 and < 85

o "C": percentage ≥ 50 and < 70

o "F": otherwise

Part C:

• Find and display the student(s) with the highest and lowest averages.

• For each subject (column), calculate and display the class average.

Part D:

• List the names of students who failed at least 2 subjects (score < 50 in any subject).

• Display each student’s name, grades for each subject, total, average, percentage, and final letter
grade.

Question 2: Warehouse Inventory Tracker

Section 1:
Declare and input into arrays:

• ItemName (string, size 8)

• Stock (integer, size 8)

• PurchasePrice (float, size 8)


• SellPrice (float, size 8)

Section 2:

• For each item, compute profit per unit (sell - purchase).

• If stock < 5, mark for "Restock".

• If profit per unit < 10% of sell price, mark as "Low Profit".

Section 3:

• For all restocked items, increase stock by 20.

• If the updated stock is now over 50, mark as "Bulk".

• Find and display the item with the highest total profit (profit per unit × stock).

Section 4:

• For each item, output:

o Name

o Stock

o Profit per unit

o Total profit

o Status(es): "Restock", "Low Profit", "Bulk" as appropriate

Question 3: City Weather Data Processing

Part 1:
Declare a 4×12 array to hold average monthly temperatures (for 4 cities over 12 months).
Declare a list of city names.

Part 2:

• For each city, find:

o The hottest month (index and temperature)

o The coldest month (index and temperature)

o The average annual temperature

Part 3:
• Across all cities, find the month with the highest average temperature and the month with the
lowest average temperature.

Part 4:

• For each city, determine:

o Number of months with temperature > 30°C ("hot months")

o Number of months with temperature < 10°C ("cold months")

Display all results in a clear, structured format.

Question 4: Advanced Transaction Processor

Section A:
Declare arrays for 12 transactions:

• CustomerName (string)

• Amount (float)

• PaymentMethod (string: "Card", "Cash", "Online")

Section B:

• Mark every transaction over $500 as "Large".

• Apply a 5% discount for "Card" payments over $200.

• For "Online" payments, add a $2 bonus if amount > $300.

Section C:

• Calculate and display, per payment method:

o Total sales

o Number of sales over $400

Section D:

• Identify and display:

o The customer with the highest final transaction amount (after discounts/bonuses)

o The method with the most total transactions

Section E:
• Print a transaction summary table showing names, original and final amounts, payment method,
and tags ("Large", "Discounted", "Bonus", etc.).

Question 5 : Interlinked Matrix Analysis and Reporting

Stage 1: Input

• Declare two 6×6 integer arrays: MatrixA and MatrixB. Input all values.

Stage 2: Processing

• For every cell [i][j]:

o If MatrixA[i][j] > MatrixB[i][j], store the difference in ResultMatrix[i][j].

o Else store their sum.

• For each row:

o Count the number of prime numbers in that row (in both MatrixA and MatrixB).

o If count ≥ 3, mark that row as "Prime-Rich".

Stage 3: Analysis

• For all "Prime-Rich" rows:

o Calculate the average value of their corresponding ResultMatrix entries.

• Find and mark any columns in ResultMatrix where all entries are even.

Stage 4: Reporting

• Display:

o all "Prime-Rich" rows and their averages,

o the indices of columns with all-even entries,

o the maximum and minimum values in ResultMatrix, along with their positions,

o final ResultMatrix.

Let me know if you’d like further questions or worked solutions for any!

You might also like