oh yeah thanks , i got it work with String.valueOf()
but while adding 3333333333333 + 3 it gives me an error :
Exception in thread "main" java.lang.NumberFormatException: For input string:...
Type: Posts; User: Dixxon
oh yeah thanks , i got it work with String.valueOf()
but while adding 3333333333333 + 3 it gives me an error :
Exception in thread "main" java.lang.NumberFormatException: For input string:...
i think it would look like :
public static String addera (String tal1, String tal2)
{
String Numb1= "30";
String Numb2 ="30";
int IntNumb1 = Integer.parseInt(Numb1);
int IntNumb2 =...
will that work ? as the method i am using is a string method , looks like this
public static String add (String numb1, String nub2)
{
// any code
}
hey
i am trying to add two strings as numbers, as an exampel :
String numb1 ="30";
String numb2 ="30";
where the answer would be 60 and not 3030. any ideas how to do that ?
i am very new to java and this was the best i could come up with... so i will just wait for some who can fix the problem
i meant that it doesnt really matter for me if the code is poorly written as long it works and are able to run the porgram ... so any idea how to get the highest vaule ?
hehe no i meant that it works as it should except registering the right highest value
what do you mean ? i just put the code in eclipse (editing program) and run the program. i just tested and it worked.
and yh i know its poorly formatted but it does not matter right now as long as...
so i did my best
import java.util.*; // Scanner, Locale
class tempraturmätningar
{
public static void main (String[] args)
{
System.out.println ("values\n");
ahh its kinda written in swedish (i translated the the small code above before posting ) so will it be any help to get the program? .... btw exercise is about using arrays so maybe there is a better...
ohh yeah i enter "5"and "6" and yet the array had a zero value
also here is the behavior when entering negtive vaules
input:
week 1 :-5.0 -8.0
week 2 : -6.0 -3.0
output:
an ID [0.0,...
ah never mind , my bad ... it gave "an ID [0.0, 5.0, 6.0]"
it gives a error
ps:sorry btw i am very new to java :)
ohh i hope that the code is cleaner now :)
it should not contain any zeros as the array contains only users input which in this cause are only negative nummbers.
i noticed that...
double[]
t[week][Measurement] = in.nextDouble (); // input
int NumberOfWeeks = in.nextInt (); // input
int MeasurementWeekly = in.nextInt (); // input
sum = new double[NumberOfWeeks +...