Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
help with code
Name: jillsmith09 Date: May 16, 2009 at 23:15:29 Pacific OS: Windows XP Subcategory: Java
Comment:
I can not find my mistake... Can you help? Thank you ...
import java.util.Scanner; //import scanner
public class Assignment10_2 { public static void main(String[] args) { //create a scanner Scanner input = new Scanner(System.in);
//Get number of items in inventory System.out.print("Please enter the total number of items in inventory: "); int numberOfItemsInInventory = input.nextInt();
//Array prices int[]price = new int[numberOfItemsInInventory]; //array prices int best = 0; //highest price char inventory; //inventory
//read the price and find the best price for (int i = 0; i < price.length ; i++) { System.out.print("Please enter a price: "); price[i] = input.nextInt();
if (price[i] > best) best = price[i]; }
//Declaring and initializing output string String output = " ";
// assign and display inventory pricing catagory for (int i = 0; i < price.length ; i ++){ if (price[i] >= best - 33) inventory = "H"; //High end inventory
else if (price[i] >= best - 66) inventory = "M"; //middle end inventory
Summary: My program will not output the second part : where it has to add the even numbers and show the sum. I did not code the third part with letters yet... Please help with this... //***********************...
Summary: Hi, im 'trying' to make a program where the user guesses 3 random numbers. I have built a gui for it and got code for it but i cant get it working correctly. The code is as follows.... import java.awt...
Summary: HI THERE IM HAVING TROUBLE PRODUCING SOME VBA CODING IN MICROSOFT EXCEL THAT WILL IMPLIMENT THE FOLLOWING CODE, I WOULD BE GREATFULL IF ANYONE COULD HELP ME ON THIS AS I AM NEW TO USING VBA AND FINDIN...