Part of the series

Several example codes

~1 min read • Updated Oct 12, 2025

Program Overview

This Python program receives the current salary salary and the increase multiplier x (e.g., 0.15 for 15%) and calculates the new salary.
The function adjust_salary performs the calculation, and the main program uses it for an employee.


Python Code:


def adjust_salary(salary: float, x: float) -> float:
    return salary * (1 + x)

# Read inputs from user
salary = float(input("Enter current salary: "))
x = float(input("Enter salary increase multiplier (e.g., 0.15 for 15%): "))

new_salary = adjust_salary(salary, x)
print(f"New salary is: {new_salary:.2f}")

Sample Output (input: salary = 10_000_000, x = 0.15):


New salary is: 11500000.00

Written & researched by Dr. Shahin Siami