0% found this document useful (0 votes)
13 views3 pages

Pseudocode

The document is a Pascal program that calculates sales commissions for employees based on their total sales and a specified commission threshold. It collects employee names and sales data, computes individual commissions, and outputs the total number of employees along with average sales and commissions. The program uses arrays to store employee data and performs calculations based on user input.

Uploaded by

melteno.lopez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Pseudocode

The document is a Pascal program that calculates sales commissions for employees based on their total sales and a specified commission threshold. It collects employee names and sales data, computes individual commissions, and outputs the total number of employees along with average sales and commissions. The program uses arrays to store employee data and performs calculations based on user input.

Uploaded by

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

PROGRAM SalesCommission;

USES crt;

VAR
commission_threshold, total_sales, commission, total_sales_sum, total_commission_sum:
Real;
employee_name: String;
num_employees, i: Integer;
employee_names: Array[1..100] of String;
employee_sales: Array[1..100] of Real;
employee_commissions: Array[1..100] of Real;

BEGIN
clrscr;

// Initialize variables
total_sales_sum := 0;
total_commission_sum := 0;
num_employees := 0;

// Input the commission threshold


Write('Enter the commission threshold: ');
Readln(commission_threshold);

// Loop to accept employee data


REPEAT
Write('Enter the employee name (leave empty to stop): ');
Readln(employee_name);

IF employee_name <> '' THEN


BEGIN
// Increment the number of employees
num_employees := num_employees + 1;

// Store employee name


employee_names[num_employees] := employee_name;

// Input total sales


Write('Enter total sales for ', employee_name, ': ');
Readln(total_sales);

// Store employee sales


employee_sales[num_employees] := total_sales;

// Calculate commission based on threshold


IF total_sales < commission_threshold THEN
commission := total_sales * 0.0725
ELSE
commission := total_sales * 0.125;

// Store employee commission


employee_commissions[num_employees] := commission;

// Add to total sums


total_sales_sum := total_sales_sum + total_sales;
total_commission_sum := total_commission_sum + commission;

Writeln; // Line break for better readability


END;

UNTIL employee_name = '';

// Output the employee data


Writeln('Employee Data:');
FOR i := 1 TO num_employees DO
BEGIN
Writeln('Employee Name: ', employee_names[i]);
Writeln('Total Sales: ', employee_sales[i]:0:2);
Writeln('Commission: ', employee_commissions[i]:0:2);
Writeln; // Line break for better readability
END;

// Output the number of employees


Writeln('Number of employees: ', num_employees);

// Calculate and output average sales and commission


IF num_employees > 0 THEN
BEGIN
Writeln('Average Sales: ', (total_sales_sum / num_employees):0:2);
Writeln('Average Commission: ', (total_commission_sum / num_employees):0:2);
END
ELSE
Writeln('No employees were entered.');

Readln;
END.
LINK TO PROGRAMME:
https://www.onlinegdb.com/edit/odmrduvQ8

You might also like