Design program to asks for number of fat grams

Assignment Help Programming Languages
Reference no: EM1359140

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows:

- Make sure the number of fat grams and calories are not less than 0.

- According to nutritional formulas, the number of calories cannot exceed fat grams X 9. Make sure that the number of calories entered is not greater than fat grams x 9.

Once correct data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula:

Percentage of calories from fat = (fat grams x 9) / calories

Some nutritionists classify a food as "low fat" if less than 30 percent of its calories come from fat. If the results of this forumlas are less than 0.3, the program should display a message indicating the food is low in fat.

Reference no: EM1359140

Questions Cloud

Prepare analysis and recommendations : You and your best friend have decided to quit your jobs, turn in your retirement, and purchase your own restaurant. In your market area there are a lot of restaurants, and you've looked at several that were available for sale.
Small businesses legal structures : What form of ownership seems best and discuss the pros and cons of the alternative forms of ownership that lead to your decision.
Illustrate what kind of gap-inflationary or recessionary : Illustrate what kind of gap-inflationary or recessionary-will the economy face after the shock, and what type of fiscal policies, giving specific examples, would help move the economy back to potential output.
Describe distinguish between crowding out and crowding : Describe Distinguish between crowding out and crowding in and It is often said that we are passing our national debt on to our children and grandchildren
Design program to asks for number of fat grams : Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories are not less than 0.
Product development and the business plan : Which section or sections of a business plan submitted to venture capitalists are the strongest and which sections are traditionally the weakest?
What is the direction of its velocity relative to the frame : what is the direction of its velocity relative to the frame of reference.
Illustrate what we did not realize at the time : Illustrate what we didn't realize at the time was that our fixed costs were underestimated by at least 30 percent. This means that we will have to adjust our price upward by at least.
Calculate the expected return of portfolio : Consider the following data, Portfolio is invested 16 percent each in A and C, and 68 percent in B. Determine the expected return of the portfolio?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd