logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Wayne FlynnManagement
(5/5)

803 Answers

Hire Me
expert
Arthur McphersonPsychology
(5/5)

599 Answers

Hire Me
expert
Jovette BermanBusiness
(5/5)

995 Answers

Hire Me
expert
George DavinComputer science
(5/5)

974 Answers

Hire Me
Python Programming
(5/5)

Write a Python program to demonstrate multiple inheritance.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Assignment Questions

 

 

Q1. Write a Python program to demonstrate multiple inheritance.

1. Employee class has 3 data members EmployeeID, Gender (String), Salary and PerformanceRating(Out of 5) of type int. It has a get() function to get these details from the user.

2. JoiningDetail class has a data member DateOfJoining of type Date and a function

getDoJ to get the Date of joining of employees.

3. Information Class uses the marks from Employee class and the DateOfJoining date from the JoiningDetail class to calculate the top 3 Employees based on their Ratings and then Display, using readData, all the details on these employees in Ascending order of their Date Of Joining.

 

Q.2 Write a Python program to demonstrate Polymorphism.

1. Class Vehicle with a parameterized function Fare, that takes input value as fare and returns it to calling Objects.

2. Create five separate variables Bus, Car, Train, Truck and Ship that call the Fare

function.

3. Use a third variable TotalFare to store the sum of fare for each Vehicle Type.

4. Print the TotalFare.

 

Q3. Consider an ongoing test cricket series. Following are the names of the players and their scores in the test1 and 2.

 

Test Match 1 :

 

Dhoni : 56 , Balaji : 94

 

Test Match 2 :

Balaji : 80 , Dravid : 105

Calculate the highest number of runs scored by an individual cricketer in both of the matches. Create a python function Max_Score (M) that reads a dictionary M that recognizes the player with the highest total score. This function will return ( Top player , Total Score ) . You can consider the Top player as String who is the highest scorer and Top score as Integer .

 

Input : Max_Score({‘test1’:{‘Dhoni’:56, ‘Balaji : 85}, ‘test2’:{‘Dhoni’ 87, ‘Balaji’’:200}}) Output : (‘Balaji ‘ , 200)

 

Q4. Create a simple Card game in which there are 8 cards which are randomly chosen from a deck. The first card is shown face up. The game asks the player to predict whether the next card in the selection will have a higher or lower value than the currently showing card.

 

For example, say the card that’s shown is a 3. The player chooses “higher,” and the next card is shown. If that card has a higher value, the player is correct. In this example, if the player had chosen “lower,” they would have been incorrect. If the player guesses correctly, they get 20 points. If they choose incorrectly, they lose 15 points. If the next card to be turned over has the same value as the previous card, the player is incorrect.

 

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme