Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. For second task you will write a function (not a class method) that takes a list of elements as parameter and returns nothing. Function

image text in transcribed

2. For second task you will write a function (not a class method) that takes a list of elements as parameter and returns nothing. Function will check whether the elements in the list can create compounds or not. There are 3 types of compounds and rules to create them can be found below. Rules for creating a compound: a. Any number of metals can create an alloy. b. A metal and any number of nonmetals can create ionic compounds or salts C. Any number of nonmetals together can create molecular compounds If your list parameter includes a group that fits the rules above, your function should print which type of compound they may create. Lastly, add exception handling to your function. If the given list includes elements that does not fit any of the rules above, the function will throw an exception. Create a user defined exception class and handle it. Test this function in your main by sending 2 different list of elements from combinations of 4 elements you have created

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago