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

  Program to output circle-s radius-diameter-circumference

Write a program to prompt the user to enter center and a point on circle. Program must then output circle's radius, diameter, circumference, and area.

  Program to evaluate postfix expressions using a stack

Program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes. T

  Defining method dashedline with one parameter

Write a definition of method dashedLine, with one parameter, an int .

  Questions on programing problem with the process of analysis

Questions on Programing Problem with the process of analysis and reflection that went on as you developed the project.

  Program to write variable declarations and function calls

Write a program whose main function is merely a collection of variable declarations and function calls. This program reads a text and outputs the letters, together with their counts.

  Write a perl program

Write perl program which will run on my system and will start another perl program on another linux system. The main program should wait for linux perl program to complete its work and send the result to my main perl program.

  Definition of function quadratic receives double parameters

Write down definition of function named quadratic which receives 3 double parameters a , b , c . If value of a is 0 then function prints the message "no solution for a=0"

  Benefits of programming with objects and classes

How is it different from programming with functions alone? Write down benefits of programming with objects and classes in Web applications?

  Program to inputs four numbers and graphs them as pie chart

Write down a program which inputs four numbers and graphs them as pie chart.

  Create a main loop to accepts text commands

Using the ADT described in Dale p280-282, implement a FIFO Queue. Then create a main loop that accepts text commands as specified below and executes the appropriate FIFO queue functions.

  General layout for a web-based source document

Suggest the general layout for web-based source document that prospective sellers could use to explain their antiques. Information must include the user ID, password, item, dimensions, origin, condition, and asking price.

  Method takes string and integer as parameters

Write a method called multiConcat which takes a String and an integer as parameters. Return String made up of the string parameter concatenated with itself count times.

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