Write a function dimensionflip() that takes a list of observations in meters and outputs a list...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function dimensionflip() that takes a list of observations in meters and outputs a list with the corresponding observations in centimeters. Your function should only convert dimensions of positive entries; therefore, a negative dimension in meters must not be changed. For example: Input1: [1,4,5] Output1: [100,400,500] Input2: [5,9,-8,6] Output2: [500,900,-8,600] The values within the input list should not be changed following a call to this function. Write a function gradeit() that takes a number x as grade in number and return a letter grade. The valid number range is between 0 and 100. The function should do the following: • return "A" if number is greater than or equal to 80 • return "B" if number is greater than or equal to 50 • return "C" if number is less than 50 return "I" if number is out of range • You are NOT allowed to use the following constructs unless specified in the assignment directions. Using the following constructs will result in 0 (zero) for the entire submission (assignment, timed test, etc.). The restricted items are as follows: • Concepts not discussed in lectures yet . String functions • Member functions • Exceptions (can use): len () and x-x+[y1, y2,y3] • Built-in functions & types • Exceptions (can use): str(), readline(), open(), close(), write(), read(), range()..split() . Cannot use append, sort, etc. • Cannot use "Slicing" Cannot use "list comprehension" • Cannot use "not in" (together) Cannot use "in" • not allowed with conditionals Exception (can use): with range() Cannot use" and {} • Exception (can use): mathematical operations (multiply & exponents) . Data type functions . Exceptions (can use): int(), str (), float () . Break . Continue . Nested Constructs Exceptions (can use): 2-D list . Multiple returns & Multiple assignments • Recursion (not allowed unless the question explicitly states otherwise) • Functions within functions (Definitions) -- invocation is fine • Default Parameters . Global variables ▪ Keyword as variable names . while true or without proper condition Write a function dimensionflip() that takes a list of observations in meters and outputs a list with the corresponding observations in centimeters. Your function should only convert dimensions of positive entries; therefore, a negative dimension in meters must not be changed. For example: Input1: [1,4,5] Output1: [100,400,500] Input2: [5,9,-8,6] Output2: [500,900,-8,600] The values within the input list should not be changed following a call to this function. Write a function gradeit() that takes a number x as grade in number and return a letter grade. The valid number range is between 0 and 100. The function should do the following: • return "A" if number is greater than or equal to 80 • return "B" if number is greater than or equal to 50 • return "C" if number is less than 50 return "I" if number is out of range • You are NOT allowed to use the following constructs unless specified in the assignment directions. Using the following constructs will result in 0 (zero) for the entire submission (assignment, timed test, etc.). The restricted items are as follows: • Concepts not discussed in lectures yet . String functions • Member functions • Exceptions (can use): len () and x-x+[y1, y2,y3] • Built-in functions & types • Exceptions (can use): str(), readline(), open(), close(), write(), read(), range()..split() . Cannot use append, sort, etc. • Cannot use "Slicing" Cannot use "list comprehension" • Cannot use "not in" (together) Cannot use "in" • not allowed with conditionals Exception (can use): with range() Cannot use" and {} • Exception (can use): mathematical operations (multiply & exponents) . Data type functions . Exceptions (can use): int(), str (), float () . Break . Continue . Nested Constructs Exceptions (can use): 2-D list . Multiple returns & Multiple assignments • Recursion (not allowed unless the question explicitly states otherwise) • Functions within functions (Definitions) -- invocation is fine • Default Parameters . Global variables ▪ Keyword as variable names . while true or without proper condition
Expert Answer:
Answer rating: 100% (QA)
For dimensionflip def dimensionflipobservations convertedobserv... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
What is the importance of budget setting and why would it be important of it to a PR agency.
-
What is lim x tens to 0 sinx over x?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Rare Earth Clothing is a retail store specializing in women's clothing. The store has established a liberal return policy for the holiday season in order to encourage gift purchases. Any item...
-
Predict the product from reaction of the following substance (reddish brown = Br) with: (a) PBr3 (b) Aqueous H2SO4 (c) SOCl2 (d) PCC (e) Br2,FeBr3
-
Let R2 have the standard dot product. Classify the following pairs of vectors as (i) Basis, (ii) Orthogonal basis, and/or (iii) Orthonormal basis: (a) (b) (c) (d) (e) (f) 2 -R-FS 2 6 3 4-5 3-5 3-5 4-5
-
Why would two objects made of nonconducting material make a poorer capacitor than two objects of the same shape made of material that is an electrical conductor?
-
The information that follows is from Matts Hardware Companys April 30, 2014, post-closing trial balance. Required 1. Prepare a classified balance sheet for Matts Hardware. 2. Compute Matts Hardwares...
-
1. Which of the following is a CORRECT statement? 2. 3. (a) 2.3056+10.138-7.4671 = 4.9765 (b) 2.38 x 1.0 = 2.38 8.05 (c) -=2.6 3.1 (d) (1.11 0.1) x 9.0 = 9.0 A projectile travels at 0 below...
-
A piece-rate employee receives $30 for each desktop computer assembled and has a standard 40-hour workweek. During the weekly pay period ending December 16, 48 computers were assembled during 44...
-
A company uses a predetermined manufacturing overhead rate of 80% based on direct labor dollars. During the year, $538,112factory labor was incurred of which $124,506 was indirect labor. How much...
-
Draft an audit programme covering eight special points for examining the accounts of a: (a) Sports club, (b) Medical college, (c) Traveling agent, (d) College hostel, (e) Publishing company.
-
Write a short-note on the various classes of audits.
-
How do you vouch the following (a) Custom duty paid on import of machinery. (b) Income from House Property. (c) Royalty Payable to a foreign collaborator. (d) Travelling Expenses. (e) Interest and...
-
What are the features of an EDP environment that affect the nature, timing or extent of audit procedures?
-
Your client is considering computers to replace his existing manual accounting system and has asked for your advice on the matter. Discussion a. Briefly outline the stages in the development of the...
-
1b1ff B/ft Why is live load expressed in pounds per square foot and not pounds per cubic foot as is the case with dead load?
-
From 1970 to 1990, Sri Lanka's population grew by approximately 2.2 million persons every five years. The population in 1970 was 12.2 million people.What is the best formula for P, Sri Lanka's...
-
The following is an inner class that will be registered as an action listener for a JButton component: Private class ButtonListener implements ActionListener { Public void actionPerformed() { // Code...
-
A class that implements this interface can handle mouse click events. a. MouseListener b. ActionListener c. MouseMotionListener d. MouseDragListener
-
What is the difference between an argument and a parameter?
-
The imposition of new trade tariffs has resulted in tensions between the United States and some of its major trading partners. Suppose you are a small business owner in the United States. a. How...
-
Suppose you identify 10 possible investments whose payoffs are completely independent of one another. All the investments have the same expected value and standard deviation. You have $1,000 to...
-
The rise in wealth inequality in the United States has reduced the capacity of much of the population to cope with transitory income shocks. How might you expect that to impact workers preferences...
Study smarter with the SolutionInn App