Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A bag of cookies holds 80 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a

A bag of cookies holds 80 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a single serving equals 800 calories. Design and write a Java program that prompts your user for the number of cookies that he or she actually ate from one of these bags and then displays the number of calories they consumed. User should be able to enter the number of cookies only between 2 and 8 (including 2 and 8). If the user has consumed more than 500 calories, you should display a message that you have consumed more than 500 calories. If the user has consumed less than 500 calories, you should display that user has consumed less than 500 calories.

Submit the following documents.

1.Java source file

2.Screen shot for the execution of your program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions