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 statement to call calculate interest method

Write the statement(s) necessary to call the calculate interest method with an account balance of $2300.00 and an interest rate of 5%.

  Application development and programming languages

Compare and contrast object-oriented languages (Java, C++, C#, etc.) to imperative languages (C, Pascal, etc.) in terms of:

  Creating a security policy by gathering information

Suppose mantle of a security consultant. You are asked to visit a client and gather information to develop a security policy for them.

  Create logic for program to count readers by genders

Create the logic for a program that would produce a count of readers by gender within age group - that is, under 20 females, under 20 males, etc.

  Explain some ways tables can be used on web page

Tables are one of the most useful page layout tools available to web designers. Explain some ways tables can be used on a web page. Elaborate on other ways to achieve the same look.

  Display total amount owed in fixed-point notation

Enter your C++ instructions into a source file named Introductory11.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the total amount owed in fixed-point notation with two decimal places.

  Characteristics used for biometric user authentication

You have just been promoted to manager of computer security for large enterprise (XYZ Corporation). Your first project as security manager is to estimate principal physical characteristics used for biometric user authentication.

  Write a program that takes one command-line argument

Write a program called runsim that takes one command-line argument. Check for the appropriate command-line argument and output a usage message if the command line is incorrect.

  Computing average net profit per sale of product

Your company bought 250,000 online advertising impressions and made average net profit per sale of product of $5.

  Program using ten radio buttons to show five states

It is program using 10 Radio Buttons to show 5 States and 5 Capitals to user's interface. Also, there is text box to print "Correct" and "Incorrect" when Sate and the Capital is a correct match.

  Different class maintain programming programs are organized

It allows different classes to maintain programming so that programs are kept more organized. Object orientation also allows a programmer to use the same objects in different programs. Response?

  Development of computer systems track citizens

To help counter terrorism, many countries are planning and development of computer systems that track large number of citizens and their actions.

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