Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Iterating over lists with loops Google Classroom A nutrition scientist is working on code to calculate the most magnesiumrich foods. Their program processes a list

Iterating over lists with loops
Google Classroom
A nutrition scientist is working on code to calculate the most magnesiumrich foods.
Their program processes a list of numbers representing milligrams of magnesium in servings of food. The goal of the program is to create a new list that contains only the numbers that represent at least 30% of the recommended daily intake of 360 milligrams.
mgAmounts +[50,230,63,98,80,120,71,158,41]
bestAmounts ]
mgPerDay +360
mgMin * mgPerDay *0.3
FOR EACH mgAmount IN mgAmounts
{
IF (mgAmount mgMin)
{
image text in transcribed

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

Students also viewed these Databases questions

Question

4. Identify the challenges facing todays organizations

Answered: 1 week ago