Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Communications Posted 27 Aug 2017 My Price 11.00

dictionary as a parameter

Function Name:artistMishap (15 points)

Description:Define a function that takes in a dictionary as a parameter. The dictionary maps artists to the number of solo records they have (not actually correct). Your function should update each of the solo records according to the following criteria:

•If the number is odd:
oIf the number is a multiple of 7 then increment the number by 7
oIf the number is a multiple of 5 then decrease the number by a factor

of 5 (keep it as an integer)
oElse if the number is a multiple of 3 then decrement the number by 3

•If the number is even:
oIf the number is a multiple of 7 then decrement the number by 7
oElse if the number is a multiple of 5 then increment the number by 5 oIf a number is a multiple of 3 then increment the number by a factor

of 3
oAlwayssquare the number

Note: Some number may be a multiple of any combination of 3, 5, or 7. Also, the numbers in your dictionary should and will change as you go through the different cases. It is your job to make sure that number is only changed according to the correct criteria (i.e. if the number is 105 that means it is odd and a multiple of 3, 5 and 7. However we willonlyincrement the number by 7 because the updated value in the dictionary after we check to see if it is a multiple of 7 is now112,which is not a multiple of either 5 or 3).

After updating the values in the dictionary, your function should return a tuple of tuples. The first tuple contains the artist with the minimum number of solo records, and the second tuple contains the artist with the maximum number of solo records. Each of the tuples should be represented as (artist, number_of_records), and both of these tuples should be placed within one tuple.

Parameter(s):

1. A dictionary. The keys are strings and the values are integers. a. Thekeysaretheartists.
b. The values are the corresponding artists’ solo records.

CS 1301 – Homework 5: Tuple and Dictionary Manipulation – Fall 2016

Return Value:A tuple containing two tuples. Thefirst tupleis the artist with the minimumnumber of solo records. Thesecond tupleis the artist with the maximumnumber of solo records. Each of the tuples has theartist(as astring) as thefirst elementandthe number of solo records(as aninteger) as thesecond element.

Example(s):

>>> artists = {"Shakira": 65, "Carlos Vivez": 42, "Juanes": 38, "Neon Trees": 30,
"Walk the Moon": 15, "Kacey Musgraves": 7, "Justin Timberlake": 63, "Michael Jackson": 70, "Michael Buble": 35, "Papa Roach": 26, "Disturbed": 21, "Lil Jon": 30}

>>> print(artistMishap(artists))
(('Walk the Moon', 3), ('Michael Jackson', 35721))

Answers

(5)
Status NEW Posted 27 Aug 2017 11:08 AM My Price 11.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)
Relevent Questions