Write pseudocode (using pascal) to accept as input names of an unspecified number of equipment rented, the name of the company, the number of days the equipment was rented for and the sales amount. The algorithm must determine the number of times each type of equipment was rented, as well as the total sales for all rentals. The algorithm should also print a list of companies that rented equipment for more than 30 days . ( Make use of arrays )

read the cost of a meal at a restaurant. if a 10% service charge were added to the bill, write an algorithm to calculate and return the total amount on the bill

Sure! Below is the pseudocode in Pascal for solving the problem:

```
program EquipmentRentals;

const
MAX_EQUIPMENTS = 100;
MAX_COMPANIES = 100;

type
Equipment = record
name: string;
rentedCount: integer;
end;

Company = record
name: string;
rentalDays: integer;
salesAmount: real;
end;

var
equipments: array[1..MAX_EQUIPMENTS] of Equipment;
companies: array[1..MAX_COMPANIES] of Company;
totalSales: real;
numEquipments, numCompanies: integer;

procedure InitializeEquipments;
var
i: integer;
begin
for i := 1 to MAX_EQUIPMENTS do
begin
equipments[i].name := '';
equipments[i].rentedCount := 0;
end;
end;

procedure InitializeCompanies;
var
i: integer;
begin
for i := 1 to MAX_COMPANIES do
begin
companies[i].name := '';
companies[i].rentalDays := 0;
companies[i].salesAmount := 0;
end;
end;

function FindEquipmentIndex(name: string): integer;
var
i: integer;
begin
for i := 1 to numEquipments do
begin
if equipments[i].name = name then
begin
FindEquipmentIndex := i;
exit;
end;
end;
FindEquipmentIndex := 0;
end;

procedure ReadInput;
var
equipmentName, companyName: string;
rentalDays: integer;
salesAmount: real;
begin
numEquipments := 0;
numCompanies := 0;

writeln('Enter equipment rentals. Press enter key to stop.');

repeat
write('Enter equipment name: ');
readln(equipmentName);

if equipmentName = '' then
break;

write('Enter company name: ');
readln(companyName);

write('Enter rental days: ');
readln(rentalDays);

write('Enter sales amount: ');
readln(salesAmount);

// Update equipments array
numEquipments := numEquipments + 1;
if FindEquipmentIndex(equipmentName) = 0 then
begin
equipments[numEquipments].name := equipmentName;
equipments[numEquipments].rentedCount := 1;
end
else
equipments[FindEquipmentIndex(equipmentName)].rentedCount := equipments[FindEquipmentIndex(equipmentName)].rentedCount + 1;

// Update companies array
numCompanies := numCompanies + 1;
companies[numCompanies].name := companyName;
companies[numCompanies].rentalDays := rentalDays;
companies[numCompanies].salesAmount := salesAmount;

until false;
end;

procedure PrintEquipmentRentals;
var
i: integer;
begin
writeln;
writeln('Equipment Rentals:');
for i := 1 to numEquipments do
writeln(equipments[i].name, ': ', equipments[i].rentedCount, ' times');
end;

procedure CalculateTotalSales;
var
i: integer;
begin
totalSales := 0;
for i := 1 to numCompanies do
totalSales := totalSales + companies[i].salesAmount;
end;

procedure PrintCompaniesRentingMoreThan30Days;
var
i: integer;
begin
writeln;
writeln('Companies Renting for More Than 30 Days:');
for i := 1 to numCompanies do
if companies[i].rentalDays > 30 then
writeln(companies[i].name);
end;

begin
InitializeEquipments;
InitializeCompanies;
ReadInput;
PrintEquipmentRentals;
CalculateTotalSales;
PrintCompaniesRentingMoreThan30Days;
end.
```

This program uses two record types, `Equipment` and `Company`, to store the information about equipment rentals and companies respectively. It uses arrays `equipments` and `companies` to store multiple records of these types. The program reads the input for equipment rentals, updates the equipment count and rental count for each equipment, and calculates the total sales. Finally, it prints the equipment rentals and the companies renting equipment for more than 30 days.