Skip to content

Garrett's Caloric Intake Calculator

Notifications You must be signed in to change notification settings

Rose-Rick/comp170_program1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Program 1 - Garrett's Popcorn Calorie Calculator

Garrett's popcorn is looking to hire a developer to create a program that allows a customer to determine the total number of calories based on the number of cups of popcorn the user enters. The nutritional facts state that there are 150 calories (54 calories from fat) per 1 cup (30 grams) of Garrett's mixed popcorn. You will create a program that lets the customer enter the number of cups of popcorn consumed and then report 1) the total number of calories consumed 2) the total number of calories from fat, and 3) the amount of popcorn in grams consumed. Your program should operate similarly to the program shown in the .gif below

Alt text

Listed below is a list of requirements that need to be completed for your program

Requirement 1 ( 5 Points)

Variables are properly declared and initialized; Use of Scanner Object to read input from console

//Example of declaring a variable named number
int number; 

//Example of declaring the Scanner Object and reading/converting string data into integer
Scanner scn = new Scanner(System.in);
number = Integer.parseInt(scn.nextLine()); 

Requirement 2 (5 Points)

Input/Output of all necessary information; Program renders format and content displayed above in .gif

Requirement 3 (5 Points)

Correct calculations are made for cup to calorie conversion, calories from fat and cup to grams; Make use of constant final variables. When possible, make sure to declare all variables that will hold data.

//Example of declaring a variable that should not change during runtime
final double AMC_STOCK_DIVIDEND_RATE = .07;

Requirement 4 (5 Points)

Style - Use of comments, space and descriptive variable names. For this course, we will follow the Google Java Style Guide. You do not need to read the entire style guide, but rather follow the convention that I have used in class and in my videos. The link below is for your reference.

Google Java Style Guide

Requirement 5 (5 Points)

Program is submitted by the due date listed and uploaded to assigned GitHub Repository

Resources

Link to Nutrical Facts Site Alt text

Submission

For program 1, you will only need to upload the .java file that contains your code to Sakai under the Assignment tab. You will also need to upload the .java file to this repository.

About

Garrett's Caloric Intake Calculator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%