1. A Grave is a dictionary with two keys: 'name': A string value with the grave's occupant's name 'message': A string value with the grave's message Define a function named count_shouters that consumes a list of graves and produces an integer representing the number of graves that had their messages in all capital letters. Hint: use the .upper() method. You are not required to document of unit test the function. 2. A Media is a dictionary with the following keys: "name": The name of this media "kind": Either "movie", "song", or "game" "duration": The length of this media in minutes Define the function longest_kind that consumes a list of Media and produces a string value representing the kind that had the highest duration. If the list is empty, return the value None. You are not required to document of unit test the function.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Please help me write the code to produce the outcome scenarios below. Thank you

1. A Grave is a dictionary with two keys:

'name': A string value with the grave's occupant's name

'message': A string value with the grave's message

Define a function named count_shouters that consumes a list of graves and produces an integer representing the number of graves that had their messages in all capital letters. Hint: use the .upper() method.

You are not required to document of unit test the function.

2.

A Media is a dictionary with the following keys:

"name": The name of this media

"kind": Either "movie", "song", or "game"

"duration": The length of this media in minutes

Define the function longest_kind that consumes a list of Media and produces a string value representing the kind that had the highest duration. If the list is empty, return the value None.

You are not required to document of unit test the function.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Knowledge Booster
Operations of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT