Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Suppose there is XYZ Company and there are different departments like production, marketing, finance, sales etc. Manager of the company want to know about the detail of the employees who are highly paid in each of the department. Write a program using the concept of classes to implement the same.


Q2. A vender wants to determine whether he should serve foods to someone. He only serves
foods to people whose age is 18 or more and when he is not on fasting. Given the person's age,
and whether fasting time is in session, create a function which returns whether he should serve
foods.
Examples
should_serve_foods(17, True) ➞ False(No serve foods)
should_serve_foods(19, False) ➞ True(serve foods)
should_serve_foods(30, True) ➞ False(No serve foods)
Q1. Suppose there is two different types of dictionary, one dictionary contains registration
number and name of student and another dictionary contains registration number and marks.
Take 5 student details. Now display the student's result in terms of grade from the following
condition:
If marks between 90 to 100:grade'O'
marks between 80 to 90:grade'A+'
marks between 70 to 80:grade'A'
marks between 60 to 70:grade'B+'
marks between 50 to 60:grade'B'
Display result in the form of dictionary.
Suppose there is two different types of dictionary, one dictionary contains employee id and
name of employee and another dictionary contains employee id and salary. Take 5 employee
details. Now display the employee's designation from the following condition:
If salary between 80,000 to 90,000:designation:Project Manager
salary between 70,000 to 80,000:designation:Team Leader
salary between 60,000 to 70,000:designation:Software Developer
salary between 50,000 to 60,000:designation:Software Trainee
Display result in the form of dictionary.
Part 2

Invent your own function that does some useful computation of your choosing. Do not copy the function from somewhere else. Use incremental development, and record each stage of the development process as you go. Finally, print output that demonstrates that the function works as you intended.

Include all of the following in your Learning Journal:

An explanation of each stage of development, including code and any test input and output.
The output of three calls to your function with different arguments.
Part 1
Section 6.2 of your textbook describes incremental development. Do the exercise at the end of that section:

As an exercise, use incremental development to write a function called hypotenuse that returns the length of the hypotenuse of a right triangle given the lengths of the other two legs as arguments. Record each stage of the development process as you go. (Downey, 2015)

After the final stage of development, print the output of hypotenuse(3, 4) and two other calls to hypotenuse with different arguments.

Include all of the following in your Learning Journal:

An explanation of each stage of development, including code and any test input and output.
The output of hypotenuse(3,4).
The output of two additional calls to hypotenuse with different arguments.
Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working.

Describe each possibility in your own words.

Define "precondition" and "postcondition" as part of your description.

Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.
Suppose you are planning to go to park so you are going to check tickets criteria online. The
ticket rates details have been given
*If children below 10 are not allowed to swing
*If age is between 10 to 15 allowed to swing and getting 10 % discount
*If age is between 15 to 20 allowed to swing and getting 5 % discount
*If age is more than 20 not then not eligible for swing and discount
The age of person will run until you enter the age of last family member and then calculate the total charge amount after entering each person’s age. Assume price of ticket is 100 Rs. each
person.
Suppose there is XYZ Company and there are different departments like production,
marketing, finance, sales etc. Manager of the company want to know about the detail of the employees who are highly paid in each of the department. Write a program using the concept of
classes to implement the same.
Give a string, write a program to move all the numbers in it to its end
LATEST TUTORIALS
APPROVED BY CLIENTS