Unit 4 Programming Assignment In this assignment, you will again modify your Quiz program from the previous assignment. You will create a separate class for quiz questions, and you will create objects of that class to ask questions and check answers. This assignment will include multiple cut-and-paste operations from the existing "Quiz" class into the new "MultipleChoiceQuestion" class. Object-oriented programming is designed to avoid cut and paste, and you will see some of the techniques for re-using existing code in the next assignment. In this assignment, however, you will be converting from procedural programming to object-oriented programming, and cut-and-paste is a simple strategy for this conversion.
Give an example of a class and an example of an object. Describe what a class is, what an object is, and how they are related. Use your examples to illustrate the descriptions.
Your Discussion should be at least 250 words in length, but not more than 750 words.
Assume in a video game, there are three agents named Rage, Jett, and Sage. Each of these agents has three normal skills along with an ultimate skill. Each of these skills have a damage score. To calculate the additive of this score, you need to use the following formula. additive_damage_score = sum of the Normal Skill Damage + Ultimate skill damage Now, write a Python program that will detect the agent’s name using “additive_damage_score” the from a given dictionary where the keys are "Normal Skills", "Ultimate Skill" and the values are the damages due to the use of those skills on the opponents. • If the additive damage score is less than or equal to 70, then the agent’s name is “Rage”. • If the additive damage score is greater than 70 and less than or equal to 100, then the agent’s name is “Jett”. • Otherwise, the agent’s name is “Sage”.
Assume, you have been given a dictionary named dict_1. The values of the dictionary will be a list or a tuple depending on the case of the dictionary key. If the key is in lower case, then the value will be in list format. If the key is in upper case, then the value will be in tuple format. Now, write a Python program that creates a new dictionary named “dict_primes” that contains only the prime numbers in the value. Then, finally, print the dictionary dict_primes. ============================================================================= Given dictionary1: {"a":[5,2,55,17],"P":(11,121,222),"B":(37,53,71),"c":[45,92,50]} Sample Output 1: dict_primes = {'a': [5, 2, 17], 'P': (11,), 'B': (37, 53, 71), 'c': []}
Write a Python program that takes a tuple of tuples as an input from the user. Then calculates the average value of the numbers for each tuple of tuples and find the tuple whose sum is the maximum. [You are not allowed to use max () function here. You are not allowed to use Regex split in this task.] Hints: Since the input function converts everything to string by default. You might need to use strip() and split() to get the data/tuples. =========================================================== Sample Input1: ((33, 22, 11), (30, 45, 56, 45,20), (81, 90, 39, 45), (1, 2, 3, 4,5,6)) Sample Output2: Average of tuples: [22.0, 39.2, 63.75, 3.5] Tuple with maximum sum is (81, 90, 39, 45)
2.We all know that the additive primaries are red, green, and blue. Now, write a Python program that will take a color sequence as a
string from the user where R represents Red, G represents Green and B represents Blue. The program should print the choice of
colors that is actually a tuple containing the sub-tuples as (color_name, color_frequency) only if the color_frequency for that color is
at least one in the given color sequence. [You are not allowed to use count() function here.]
===========================================================
Sample Input1:
"RGBRRGBBR"
Sample Output1:
(('Red', 4), ('Green', 2), ('Blue', 3))
Explanation2:
In the given color sequence, “R”, “B”, and “G” have color_frequency at least one (minimum1). So, “Red”, “Green” and “Blue” are
present in the output.
Magic number: If the summation of even indexed digits is equal to the summation of odd indexed digits, then the number is
a magic number.
Now, write a Python program that will take a string of numbers where each number is separated by a comma. The program should
print a tuple containing two sub-tuples, where the first sub-tuple will hold the magic numbers and the second sub-tuple will hold
the non-magic numbers.
Sample Input1:
"1232, 4455, 1234, 9876, 1111"
Sample Output1:
((1232, 4455, 1111), (1234, 9876))
Create a c++ quiz program, in this program it has a 10 questions that the user will answer. The program has the following functions:
A. It will show the message (Correct) if the the answer is correct and (Wrong) if the answer is wrong
B. It can compute the total score
C. If the user Failed in the quiz it will ask the user if he wants to retake the quiz. ( 6 is the passing rate)
C1.1If he select Yes he will take the quiz again.
C1.2. If he select No the program will automatically closed.
Extra 10 points: use system(“clear”) to clear the the previous data in the screenx
Activity 2 Read the words in this notice that are in larger print. LOST CAT
We lost our cel, Sam on Thursday 24 October. She has never run away before and we think that she has wandered out and got lost. BLACK AND WHITE
She's large, round and healthy looking. She is a well looked ofter and much loved pol. Sho was last seen in the
CHAPEL STREET AREA.
If you have seen her or think you know where she might be Contact: JULIUS JORDAN .
Create a program that will ask the user to input 9 integer numbers and display its vertical and horizontal sum. The numbers should be encoded in a 3 rows and 3 columns manner. After the user entered each set of numbers in a row, the horizontal sum of the set of numbers should automatically be shown.