Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Received this error. No idea how to fix it. Error: Could not find or load main class it511.it511.IT511 Caused by: java.lang.ClassNotFoundException: it511.it511.IT511 Command execution failed.

Received this error. No idea how to fix it.

Error: Could not find or load main class it511.it511.IT511 Caused by: java.lang.ClassNotFoundException: it511.it511.IT511 Command execution failed.

Code below

package SteppingStones;

import java.util.Scanner; /** * * */ public class SteppingStone2_IngredientCalculator_1 {

String nameOfIngredient = ""; float numberCups = 0.0f; int numberCaloriesPerCup = 0; double totalCalories = 0.0f;

/** *Assign the following variables with the appropriate data type and value:

*VARIABLE NAME VALUE

*nameOfIngredient "" *numberCups 0 *numberCaloriesPerCup 0 *totalCalories 0.0

*/

Scanner scnr = new Scanner(System.in);

System.out.println("Please enter the name of the ingredient: "); nameOfIngredient = scnr.next();

System.out.println("Please enter the number of cups of " + nameOfIngredient + " we'll need: "); numberCups = scnr.nextFloat();

System.out.println("Please enter the name of calories per cup: "); numberCaloriesPerCup = scnr.nextInt();

/** * Write an expression that multiplies the number of cups * by the Calories per cup. * Assign this value to totalCalories */

System.out.println(nameOfIngredient + " uses " + numberCups + " cups and has " + totalCalories + " calories.");

totalCalories = numberCups + numberCaloriesPerCup;}

}

Attaching ss of netbeans

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

Step: 3

blur-text-image

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions