Implement the following: 1) Define a class Job with two attributes title and salary. 2) Define an init method for Job which sets the attribute values via input parameters. 3) Create a Job instance named myJob with attribute values "programmer" and 100000. 4) Access and print the title and salary attribute values of myJob. Make sure to precisely match the output format below. Write your code in the ANSWER area provided below (must include comments if using code is not covered in the course). Example Output PROGRAMMER $100,000 PYTHON
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Implement the following:
1) Define a class Job with two attributes title and salary.
2) Define an init method for Job which sets the attribute values via input parameters.
3) Create a Job instance named myJob with attribute values "programmer" and 100000.
4) Access and print the title and salary attribute values of myJob.
Make sure to precisely match the output format below.
Write your code in the ANSWER area provided below (must include comments if using code is not covered in the course).
Example Output
PROGRAMMER
$100,000
PYTHON
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images