gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
are you there
- User
are you there
- Assistant
Yes, I'm here! How can I assist you today?
- User
can you finish this cobol code: This example will cover calculating the gross salary of an employee based on hours worked and hourly rate, then applying deductions for taxes.
IDENTIFICATION DIVISION. PROGRAM-ID. PayrollCalculation. DATA DIVISION. WORKING-STORAGE SECTION. 01 Employee-Data. 05 Hours-Worked PIC 9(3)V9(2) VALUE 0. 05 Hourly-Rate PIC 9(3)V9(2) VALUE 0. 05 Gross-Salary PIC 9(5)V9(2) VALUE 0. 05 Tax-Rate PIC 9(2)V9(2) VALUE 0.20. 05 Tax-Amount PIC 9(5)V9(2) VALUE 0. 05 Net-Salary PIC 9(5)V9(2) VALUE 0. PROCEDURE DIVISION. DISPLAY "Enter hours worked: " WITH NO ADVANCING. ACCEPT Hours-Worked. DISPLAY "Enter hourly rate: " WITH NO ADVANCING. ACCEPT Hourly-Rate. COMPUTE Gross-Salary = Hours-Worked * Hourly-Rate. COMPUTE Tax-Amount = Gross-Salary * Tax-Rate. COMPUTE Net-Salary = Gross-Salary - Tax-Amount. DISPLAY “Gross Salary: $” Gross-Salary. DISPLAY "Tax Deducted: - Assistant
Certainly! Below is the completed COBOL code to calculate the gross salary of an employee based on hours worked and hourly rate, deduct taxes, and display the results:
IDENTIFICATION DIVISION. PROGRAM-ID. PayrollCalculation. DATA DIVISION. WORKING-STORAGE SECTION. 01 Employee-Data. 05 Hours-Worked PIC 9(3)V9(2) VALUE 0. 05 Hourly-Rate PIC 9(3)V9(2) VALUE 0. 05 Gross-Salary PIC 9(5)V9(2) VALUE 0. 05 Tax-Rate PIC 9(2)V9(2) VALUE 0.20. 05 Tax-Amount PIC 9(5)V9(2) VALUE 0. 05 Net-Salary PIC 9(5)V9(2) VALUE 0. PROCEDURE DIVISION. DISPLAY "Enter hours worked: " WITH NO ADVANCING. ACCEPT Hours-Worked. DISPLAY "Enter hourly rate: " WITH NO ADVANCING. ACCEPT Hourly-Rate. COMPUTE Gross-Salary = Hours-Worked * Hourly-Rate. COMPUTE Tax-Amount = Gross-Salary * Tax-Rate. COMPUTE Net-Salary = Gross-Salary - Tax-Amount. DISPLAY "Gross Salary: $" Gross-Salary. DISPLAY "Tax Deducted: $" Tax-Amount. DISPLAY "Net Salary: $" Net-Salary. STOP RUN.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.