Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number

image text in transcribed
A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consume in a day. Then, she calculates the number of calories that result from the fat using the following formula: Calories from fat = Fat grams times 9 Next, she calculates the number of calories that result from the carbohydrates using the following formula: Calories from carbs = Carbs grams times 4 Create an application that will make these calculations. In the application, you should have the following methods: FatCalories-This method should accept a number of fat grams as an argument and return the number of calories from that amount of fat. CarbCalories-This method should accept a number of carbohydrate grams as an argument and return the number of calories from that amount of carbohydrates Write a program that asks the user to enter an item's cost and its markup percentage. It should then display the item's retail price. For example: If an item's wholesale cost is $5.00 and its markup percentage is 100 percent, then the item's retail price is $10.00. If an item's wholesale cost is $5.00 and its markup percentage is 50 percent, then the item's retail price is $7.50. The program should have a function named calc that receives the wholesale cost and the markup percentage as arguments and returns the retail price of the item

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