Yeah that was the problem I was having because thats not correct. But I guess my program is solid then.
Type: Posts; User: JBtheIV
Yeah that was the problem I was having because thats not correct. But I guess my program is solid then.
I said in my previous post that my program is running the way it should. 50 kilograms is 22.686.... and 50 pounds is 110 kilograms. I just wanted to make sure those 2 methods were set up right. I...
Oh ok, that makes alot of sense. But now when I test it again it reads something like this:
Please select the type of conversion you would like to make: 2
Please enter the kilograms: 50
50...
Quick update! I reworked my code around this time and managed to create the 3rd method. The only problem is it will give me a result something like this. Basically, I got it to print, but now it...
public static void main(){
nPounds = input.nextInt();
System.out.print(nPounds + " pounds is " + dPoundsToKilograms + " kilograms");
}
Why is it when I do this,...
Hello.
My teacher gave us an assignment.
Menu to be displayed for the user:
WEIGHT CONVERSION
1. Pounds to kilograms
2. Kilograms to pounds
Note: To indicate the type of conversion, the...
Sorry to sound like a pain but thats the problem I'm having. I honestly have no idea how to move on.
The while loop asks the user to enter a number for a product. Until they enter the integer 10 (the sentinel), it will keep asking them for a product number.
ex.
Please select an item from the...
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package orderfrommenu;
import java.util.Scanner;
/**
*
@javaiscool. Thanks man, I think I'm on to something.
I imported the code:
if (nNumber == 1){
nSum += GPOD_SHUFFLE;
}
else if (nNumber == 2){
nSum...
Sorry if I wasn't clear, but our Teacher hasn't taught us about array's yet. Therefore we should be required to figure this out without them.
Thus, thats why I need to figure out the right...
Thanks for the response. Our professor hasn't taught us about arrays so thats why it looks foreign to me.
/*
* To change this template, choose Tools | Templates
* and open the template in...
I don't know how to use arrays, or at the least, can't remember. Can you give an example?
Ok update!
I redid my coding and was able to fix the problem.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package orderfrommenu;
The customer can purchase as many items as they want. Each item corresponding to a number (1-9). The system will ask the user to enter another item until the user inputs 10. Then the total items...
Hello.
So far, I am in my 3rd week of Java programming and I've finally run into a bit of a problem. We were given an assignment of the following:
Scenario 1: Customer purchases all 9 items...