Question: Much help is needed for an upcoming Java project, Thank you in advance! Overview: In your final project, you will create a program that will

Much help is needed for an upcoming Java project, Thank you in advance!

Overview: In your final project, you will create a program that will help you manage a collection of items. To complete this program, you will implement two classes: one for the main item and one for the entire collection. If you decide to be more adventurous, you can make an additional class for the most important subcomponent of your main item class. Prompt: Your Ingredient class will model the details of individual ingredients in a recipe. Based on Stepping Stone Labs Two and Three, you will create an Ingredient class and give it the basic attributes: name, amount, unit of measure, and calories. Ensure you add these as instance variables of the ingredient class. Additionally, you will add code to validate the data type of the user input. This Ingredient class will be modified for the submission of your final RecipeManager application; however, it should be functional code that accepts user input for each variable. Specifically, the following critical elements of the final project must be addressed: I. Data Types: Your Ingredient class should properly employ each of the following data types that meet the scenarios requirements where necessary: A. Utilize numerical data types that represent quantitative values for variables and attributes in your class. B. Utilize strings that represent a sequence of characters needed as a value in your class. C. Utilize inline comments directed toward software engineers for the ongoing maintenance of your program that explain your choices of data types selected for your program. II. Algorithms and Control Structure: Your final program should properly employ each of the following control structures as required or defined by the scenario where necessary: A. Utilize expressions or statements that carry out appropriate actions or that make appropriate changes to your programs state as represented in your programs variables. B. Employ the appropriate conditional control structures that enable choosing between options in your program. C. Utilize inline comments directed toward software engineers for the ongoing maintenance of your program that explain your choices of data types selected for your program. Guidelines for Submission: Your complete program should be submitted as a Java file of the project

Critical Elements Proficient (100%) Needs Improvement (80%) Not Evident (0%) Value Data Types: Numerical Utilizes numerical data types that represent quantitative values for variables and attributes in the program, meeting the scenarios requirements Utilizes numerical data types that represent quantitative values for variables and attributes in the program, but use of data types is incomplete or illogical, contains inaccuracies, or lacks accordance with the scenarios requirements Does not utilize numerical data types that represent quantitative values for variables and attributes in the program 20 Data Types: Strings Utilizes strings that represent a sequence of characters needed as a value in the program, meeting the scenarios requirements Utilizes strings that represent a sequence of characters needed as a value in the program, but use of strings is incomplete or illogical, contains inaccuracies, or lacks accordance with the scenarios requirements Does not utilize strings that represent a sequence of characters needed as a value in the program 20 Data Types: Inline Comments Utilizes inline comments directed toward software engineers for the ongoing maintenance of the program that explain the choices of data types selected for the program Utilizes inline comments that explain the choices of data types selected for the program but inline comments are incomplete or illogical, contain inaccuracies, or lack applicability toward software engineers for the ongoing maintenance of the program Does not utilize inline comments that explain the choices of data types selected for the program 10 Algorithms and Control Structures: Expressions or Statements Utilizes expressions or statements that carry out appropriate actions or that make appropriate changes to the programs state as represented in the programs variables and meet the scenarios requirements Utilizes expressions or statements that carry out actions or that make changes to the programs state as represented in the programs variables, but use of expressions or statements is incomplete or illogical, contains inaccuracies, or lacks accordance with the scenarios requirements Does not utilize expressions or statements that carry out actions or that make changes to the programs state as represented in the programs variables 20 Algorithms and Control Structures: Conditional Control Structures Employs the appropriate conditional control structures, as the scenario defines, that enable choosing between options in the program Employs the conditional control structures that enable choosing between options in the program, but use of conditional control structures is incomplete or illogical, contains inaccuracies, or lacks accordance with the scenarios definition Does not employ the conditional control structures that enable choosing between options in the program 20 Algorithms and Control Structures: Inline Comments Utilizes inline comments directed toward software engineers for the ongoing maintenance of the program that explain how the use of algorithms and control structures appropriately addresses the scenarios information management problem Utilizes inline comments that explain how the use of algorithms and control structures addresses the scenarios information management problem, but inline comments are incomplete or illogical, contain inaccuracies, or lack applicability toward software engineers for the ongoing maintenance of the program Does not utilize inline comments that explain how the use of algorithms and control structures addresses the scenario

Stepping stone 2

package SteppingStones;

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. *package SteppingStones;

/** * * @author snhu.edu */

import java.util.Scanner;

public class SteppingStone2_Ingredient { private String nameOfIngredient; private float numberCups; private int numberCaloriesPerCup; private double totalCalories; /** * @return the nameOfIngredient */ public String getNameOfIngredient() { return nameOfIngredient; }

/** * @param nameOfIngredient the nameOfIngredient to set */ public void setNameOfIngredient(String nameOfIngredient) { this.nameOfIngredient = nameOfIngredient; }

/** * @return the numberCups */ public float getNumberCups() { return numberCups; }

/** * @param numberCups the numberCups to set */ public void setNumberCups(float numberCups) { this.numberCups = numberCups; }

/** * @return the numberCaloriesPerCup */ public int getNumberCaloriesPerCup() { return numberCaloriesPerCup; }

/** * @param numberCaloriesPerCup the numberCaloriesPerCup to set */ public void setNumberCaloriesPerCup(int numberCaloriesPerCup) { this.numberCaloriesPerCup = numberCaloriesPerCup; }

/** * @return the totalCalories */ public double getTotalCalories() { return totalCalories; }

/** * @param totalCalories the totalCalories to set */ public void setTotalCalories(double totalCalories) { this.totalCalories = totalCalories; } public SteppingStone2_Ingredient() { this.nameOfIngredient = ""; this.numberCups = 0; this.numberCaloriesPerCup = 0; this.totalCalories = 0.0; } public SteppingStone2_Ingredient(String nameOfIngredient, float numberCups, int numberCaloriesPerCup, double totalCalories) { this.nameOfIngredient = nameOfIngredient; this.numberCups = numberCups; this.numberCaloriesPerCup = numberCaloriesPerCup; this.totalCalories = totalCalories; } public SteppingStone2_Ingredient addIngredient(String tempNameOfIngredient) { tempNameOfIngredient = tempNameOfIngredient; float tempNumberCups; int tempNumberCaloriesPerCup; double tempTotalCalories; Scanner scnr = new Scanner(System.in); System.out.println("Please enter the name of the ingredient: "); tempNameOfIngredient = scnr.next(); System.out.println("Please enter the number of cups of " + nameOfIngredient + " we'll need: "); tempNumberCups = scnr.nextFloat(); System.out.println("Please enter the name of calories per cup: "); tempNumberCaloriesPerCup = scnr.nextInt(); tempTotalCalories = numberCups * numberCaloriesPerCup; SteppingStone2_Ingredient tempNewIngredient = new SteppingStone2_Ingredient(tempNameOfIngredient, tempNumberCups, tempNumberCaloriesPerCup, tempTotalCalories); return tempNewIngredient; } }

Stepping Stone 3

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package Solutions;

import java.util.Scanner;

/** * * @author snhu.edu */ public class SteppingStone3_Branches { public static void main(String[] args) { int numberCups = -1; final int MAX_CUPS = 100; Scanner scnr = new Scanner(System.in); System.out.println("Please enter the number of cups (between 1 and 100): "); if (scnr.hasNextInt()) { numberCups = scnr.nextInt(); if (numberCups >= 1 && numberCups <= MAX_CUPS) { System.out.println(numberCups + " is a valid number of cups!"); } else { System.out.println(numberCups + " is a not valid number of cups!"); System.out.println("Please enter another number of cups between 1 and 100: "); numberCups = scnr.nextInt(); if (numberCups >= 1 && numberCups <= MAX_CUPS) { System.out.println(numberCups + " is a valid number of cups!"); } else if (numberCups < 1) { System.out.println(numberCups + " is less than 1. Sorry you are out of tries."); } else { System.out.println(numberCups + " is larger than 100. Sorry you are out of tries."); } } } else { System.out.println("Error: That is not a numer. Try again."); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!