write a payroll program that promt a user to enter his name,hourly rate,working hours in the week and display the amount earning by each employee in Rand.user is not allowed to enter any negative value for hourly rate and working hours.

We would better help you if you could specify the help you need is with syntax or logic.

The best route is to post what you already have written if you have already started (pseudocode or code).

If you have not yet started, you need to tell us what you have learned so far. There are many ways to write the same program using different tools.

Program payroll (input,output);

{constants declaration}
const
Basic pay=800
{variable declaration}
var
hours:integers;
Pay per day:integer;
Basic pay:integer;
allowances:integer;
deduction:integer;
a,b,c,d:integer;
Gross pay:integer;
Net pay:integer;

{program block}
begin
Writeln('enter hours worked,);
Readln(hours worked);
Writeln('enter a');
readln(a);
................................................................

Payroll

To create a payroll program in Python that prompts the user to enter employee details (name, hourly rate, working hours) and calculates their earnings, follow these steps:

Step 1: Initialize Variables and Constants
- Define a constant variable for the maximum hourly rate allowed (this will prevent negative values).
- Create empty lists to store employee details (names, hourly rates, working hours, and earnings).

Step 2: Validate Input
- Use a while loop to prompt the user for employee details.
- Verify that the hourly rate and working hours entered by the user are positive values.
- If the user enters a negative value, display an error message and ask for valid input.

Step 3: Calculate Earnings
- Multiply the hourly rate by the working hours to calculate the earnings.
- Add the calculated earnings to the list of earnings for each employee.

Step 4: Display Results
- Use a for loop to iterate over the list of employee names and earnings.
- Print the name and earnings of each employee.

Now let's write the code:

```python
# Step 1: Initialize Variables and Constants
MAX_HOURLY_RATE = 0 # Add your maximum hourly rate allowed here
names = []
hourly_rates = []
working_hours = []
earnings = []

# Step 2: Validate Input
while True:
name = input("Enter employee name (leave empty to stop): ")
if name == "":
break
names.append(name)

while True:
hourly_rate = float(input("Enter hourly rate for %s: " % name))
if hourly_rate < MAX_HOURLY_RATE:
print("Hourly rate must be a positive value.")
else:
hourly_rates.append(hourly_rate)
break

while True:
working_hour = float(input("Enter working hours for %s: " % name))
if working_hour < 0:
print("Working hours must be a positive value.")
else:
working_hours.append(working_hour)
break

# Step 3: Calculate Earnings
for i in range(len(names)):
earning = hourly_rates[i] * working_hours[i]
earnings.append(earning)

# Step 4: Display Results
print("\nPayroll Report:")
for i in range(len(names)):
print("Employee: %s, Earnings: %.2f Rand" % (names[i], earnings[i]))
```

Note: Remember to replace `MAX_HOURLY_RATE` with an appropriate value that makes sense for your payroll program. Run the program, and you will be prompted to enter the employee details. The program will continue asking for employee details until the user leaves the name field empty. Finally, the program will display a payroll report with each employee's name and earnings in Rand.