Create program which asks for number of fat grams

Assignment Help Programming Languages
Reference no: EM1370069

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: EM1370069

Questions Cloud

Compute the related total revenue and marginal revenue : Evaluate the price and the output information in the following table. Calculate the related total revenue and marginal revenue.
Explain and develop a research report of product : Explain and develop a research report of product in accepted business style and professional recommendation as to whether or not the agency's sales team should pursue a client that sells this product.
How has nature view succeeded in the natural foods channel : How has Nature View succeeded in the natural foods channel and what are the two primary types of growth strategies under consideration by Nature View?
Describing weighted average cost of capital : Compute the weighted average cost of capital using book value weights. Compute the weighted average cost of capital using market value weights. Compare the answers obtained in parts a and b. Describe the differences.
Create program which asks for number of fat grams : Create a program which asks for number of fat grams and calories in a food item. Validate input as follows: Make sure number of fat grams and calories are not less than 0.
Show the personal reflection of environmental concerns : How big an issue is this for us, how much (if any) is business responsible for it and how much change (if any) is needed to get us on the right track
Competing in rapid-growth industries : Competing in rapid-growth industries - suitable strategy option for companies competing in rapid-growth industries?
Determining minimum variable costs of cost function : At what output is AVC at minimum? If the market price of firm's output is $7 per unit, should the firm produce or shut down?
Decisions in competitive markets : The MidNight Hour, a local nightclub, earned $100,000 in accounting profit past year. This year the owner, who had invested $1 million in club, decided to close club.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a vhdl code for soda vending machine

Write a VHDL code that implements the above soda machine. You have to turn in the following: A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.

  Develop computerized pot hole tracking and repair system

Department of public works for city has decided to develop computerized pot hole tracking and repair system. As pot holes are reported to customer service.

  Write code to find largest value found in parking tickets

Without using any additional variables, write some code that results in mostTickets containing the largest value found in parkingTickets.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Write program to compute integer part of quotient

Write program segments that accomplish each of the following: Calculate the integer part of the quotient when integer a is divided by integer b.

  Program to overload the addition assignment operator

Overload the addition assignment operator (+=), the subtraction assignment operator (-=), and the multiplication assignment operator (*=).

  Basic user interface-accept multi-level menu driven modules

Use any programming language or package to design basic User Interface which will be able to accept multi-level menu driven modules. Password should not be displayed.

  Explaining steps to execute branch instruction

Sketch a flow chart which carefully explains steps that little man follows to execute a branch instruction.

  Design implement application displays button-label on screen

Design an implement an application that displays a button and a label on a screen. Every time the button is pushed, the label will display a random number.

  Design tower of hanoi puzzle program

Implement and design Tower of Hanoi Puzzle program using C# and Windows Presentation Foundation WPF template in Visual Studio 2012 or newer.

  Why is it significant to use systems analysis

"Why is it significant to use systems analysis and design methodologies when building system? Why not just build system in whatever way seems to be quick and easy?

  Write program to allow two users to play tic-tac-toe

Write a program that will allow two users to play tic-tac-toe. The program should ask for moves alternately from player X and player O.

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