Hey guys so I'm writing this program for my class and it asks for us to somehow be able to allow the user to input a number with a weight behind it. "You will need to handle the user inputting a weight either with grams (g) or with kilograms (kg). So user input for any weight value, including the maximum, should operate under the assumption (number)(space)(unit)for example
10 kg
or
400 g". I'm not sure if he is asking for just a variable where it shows up behind the input or is he asking for us to be able to have it distinguish what form of weight it is. Im very new to this so any and all help is much appreciated!
My apologies, yes that is what they want to be inputed. My question is how would I set the variable g or kg to say that its in units of kilograms or grams? We were given the choice between the two so I have my the output set to print in kg.