Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm confused on how to do this while Loops Discussion - (10 points) Write a function called price_of_rocks. It has no parameters. In a while

I'm confused on how to do this image text in transcribed

while Loops Discussion - (10 points) Write a function called price_of_rocks. It has no parameters. In a while loop, get a rock type and a weight from the user. Keep a running total of the price for all requested rocks. Repeat until the user wants to quit. Quartz crystals cost $23 per pound. Garnets cost $160 per pound. Meteorite costs $15.50 per gram. Assume the user enters weights in the units as above. Return the total price of all of the material. For this discussion, you should first write pseudocode for how you would solve this problem (reference pseudocode.py in the Week 7 Coding Tutorials section for an example) (2pts). Then write the code for how you would tackle this function. Please submit a Python file called rocks_discussion.py (2pts) that defines the function (code) (3pts) and calls it in main() (1pt). Once you've posted, respond to another person in your section. Comment on their approach, including one thing you liked about it and whether you would do anything differently. Keep it constructive! (2pts) NOTE: Please make sure to select to post in the section with the letter in the code. It should look something like this: ISTA_130_SEC101A_2201-1

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

Step: 3

blur-text-image

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

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

Find Io in the network infigure. 8 0 O5A 3 Vs 5 A V, 6n Vx ww ww

Answered: 1 week ago