GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — salary-increase-decrease/salary_increase_decrease.py at main · AntonisParaskevis/salary-increase-decrease

Expand file tree

/

salary_increase_decrease.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
34 lines (26 loc) · 1.28 KB
/

salary_increase_decrease.py

Copy path

File metadata and controls

34 lines (26 loc) · 1.28 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
while True:
try:
# Prompt the user to enter the current salary
salary = float(input("Enter the current salary\n"))
# If the user has entered either zero or a negative number, prompt them to enter a valid input
if salary <= 0:
print("Invalid entry, please enter a number greater than zero.")
continue
break
except ValueError:
# If the user has entered a non-numerical input, prompt them to enter a valid input
print("Invalid entry, please enter a number greater than zero.")
# Store the salary in the original_salary variable to save it for later use during the program's execution
original_salary = salary
# Increase the salary by 10%
salary = salary + salary * 0.1
# Then, reduce the salary by 10%
salary = salary - salary * 0.1
# Calculate the salary change percentage
change_percentage = ((salary - original_salary) / original_salary) * 100
# Display the new salary
print("New salary: $" + str(round(salary, 2)) + ".")
# Display the salary change percentage, rounded to 2 decimals
print("Salary change percentage: " + str(round(change_percentage, 2)) + "%.")
# In the end, prompt the user to press Enter, in order to exit the program
input("Press Enter to exit the program")
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.