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

Create command line based application for perfect hundred

Create a COMMAND LINE based application to play a game called Perfect Hundred. In this game, the user/player competes against the computer.

Algorithm attributes and their importance.

Write a 2 page research paper (excluding title and reference pages) on algorithm attributes and their importance. Use two resources (Wikipedia sources are not permitted) and

Program-calculate power loss-transmitted-power generating

Write a program to calculate power loss in transmission line with resistance of 0.05 ohms/mile. Calculate power loss if 500 kW of power is transmitted from power generating s

Write a rainfall program that stores the total rainfall

Write a RainFall program that stores the total rainfall for each of 12 months into an array of doubles. Demonstrate program. Input Validation should not allow negative numbers

Create a file values.txt contains the data

Make sure your program is clear with no syntactical errors, correctly uses i/o syntax, correctly uses branching and looping syntax, that it contains functions with correct p

Write a function named dietoss

Write a function named dieToss that simulates the tossing of two dice. When you call the function, it should generate two random numbers ranged in 1 to 6 and return the sum

Write a method named maxelement

Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demo

Write a bash shell script prompt user to enter first name

Write a Bash shell script named phone.bsh that prompts the user the to enter first or last or any portion of person's name, so that can be found the appropriate entry in

Reviews

Write a Review

 
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