Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for #1040

Open
farzanehsedarati opened this issue Oct 30, 2024 · 0 comments
Open

Patch for #1040

farzanehsedarati opened this issue Oct 30, 2024 · 0 comments

Comments

@farzanehsedarati
Copy link

farzanehsedarati commented Oct 30, 2024

openapi: '3.0.2'
info:
title: JSONPlaceholder
version: '1.0'
servers:

components:
schemas:
post:
type: object
properties:
userId:
type: integer
id:
type: integer
title:
type: string
body:
type: string
parameters:
post-id:
name: post-id
in: path
description: 'key: id of post'
required: true
style: simple
schema:
type: integer

paths:
/posts:
get:
description: Get posts
parameters:
- name: userId
in: query
description: Filter results by user ID
required: false
style: form
schema:
type: integer
maxItems: 1
- name: title
in: query
description: Filter results by title
required: false
style: form
schema:
type: string
maxItems: 1
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/post'
post:
description: 'Create post'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/post'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/post'
/posts/{post-id}:
get:
description: 'Get post by ID'
parameters:
- $ref: '#/components/parameters/post-id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/post'
patch:
description: 'Update post'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/post'
parameters:
- $ref: '#/components/parameters/post-id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/post'
delete:
description: 'Delete post'
parameters:
- $ref: '#/components/parameters/post-id'
responses:
'200':
description: OK
class Employee:
def init(self, name, title, monthly_income, tax_rate, insurance, address, dob, ssn, age):
self.name = name
self.title = title
self.monthly_income = monthly_income
self.tax_rate = tax_rate
self.insurance = insurance
self.address = address
self.dob = dob
self.ssn = ssn
self.age = age
self.net_income = self.calculate_net_income()

def calculate_net_income(self):
    tax_amount = self.monthly_income * self.tax_rate
    return self.monthly_income - tax_amount - self.insurance

def display_employee_info(self):
    print(f"Name: {self.name}")
    print(f"Title: {self.title}")
    print(f"Monthly Gross Income: ${self.monthly_income}")
    print(f"Monthly Net Income: ${self.net_income}")
    print(f"Address: {self.address}")
    print(f"DOB: {self.dob}")
    print(f"SSN: {self.ssn}")
    print(f"Age: {self.age}")

Employee data for Farzaneh Sedarati

farzaneh = Employee(
name="Farzaneh Sedarati",
title="CEO",
monthly_income=3500000,
tax_rate=0.3, # Assuming 30% tax rate
insurance=0, # No insurance
address="1311 Liberty Ave, Terre Haute, Indiana 47807",
dob="04-26-1990",
ssn="9055",
age=34
)

Display employee information

farzaneh.display_employee_info()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant