Kara Wilimas

Greenhorn
+ Follow
since Oct 12, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kara Wilimas

Okay, thank you. Another error question...
How can I fix this type of error?
CDExceptionTEST.java:9: error: cannot find symbol
launcher.run(arg);
^
symbol: method run(String[])
location: variable launcher of type CDExceptionTEST

I am getting multiple errors like this.
7 years ago
Okay. Errors now:
error: non-static variable artistname cannot be referenced from a static context
error: cannot find symbol
MyException stocknegative = new MyException ();
method getMessage in class Throwable cannot be applied to given types;
albumblank.getMessage("Album name contains no characters");
error: cannot find symbol
if(albumname.length > 0){


7 years ago
< The CDTEST and CDExceptionTEST are suppose to be in the same folder? And I'm not sure what that means. >
23 errors now. Most of them will be solved if I figure that ^^ out?
7 years ago
Apologies, I currently get 12 errors.

CDTEST.java:14: error: illegal start of expression
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: illegal start of expression
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: ';' expected
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: illegal start of expression
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: ';' expected
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: illegal start of expression
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: ';' expected
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: not a statement
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: ';' expected
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: not a statement
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:14: error: ';' expected
public static void main (final String[ ] arg) throws Exception {
^
CDTEST.java:48: error: reached end of file while parsing
} //program ends
^
7 years ago
The code below is suppose to validate what is in the try/catch statement.
I am having problems in the exceptions. The strings and numbers have different criteria to conform to and I don't know how to write this code so that it checks against the validations and outputs the correct exception statement. I tried if/else the try/catch, to check all validations and and if/else in the else of the first if/else to check the different kinds of validations and to output different exceptions.
Also, really really dumb question. The CDTEST and CDExceptionTEST are suppose to be in the same folder? And I'm not sure what that means.




And this is the Exception.java program

7 years ago
Am I on the right track if I change it to this?
7 years ago
Hello,
I changed the code. Now I am having problems with counting the elements in the ValidArray, and finding the average of the elements in the array.

I am getting this as output: The number of valid grades entered is 10
[D@7ea987ac[D@7ea987acAverage: 0.0


How can I fix this?

7 years ago
Hello,

So I have to convert strings to double numbers and there can be no exception.
The strings that aren't numbers or do not fit into a set criteria have to be discarded.

When I try to write this I get an exception when a non-numeric is entered and the code stops.

What can I do?

Also, am I finding the average of the array correctly?

Thank You

7 years ago
EDIT:

The output is suppose to look like this:

number of valid grades entered: 2
92.5
100
average: 96.25

The listed numbers are to be printed in the reverse ordered they were entered.
7 years ago
So far I have this. Am I finding the array length right? and is the validation correct?

7 years ago
Hello,

I am writing a code in which a user inputs data as a string and that data must be verified as a valid number. A valid number is anything from 0-100. Then all valid numbers are converted into double numbers.

I am having trouble in how to write the validation part of the code.

Is it suppose to be an if, else statement? And if so how is it suppose to be validated?


Thank You.

7 years ago
Hello,

Thank you. I think I have it sorted now.
7 years ago
Apologies, forgot to mention that these errors occur:

Grades.java:29: error: ')' expected
double count = Double.parseDouble(String sInput);
^
Grades.java:29: error: illegal start of expression
double count = Double.parseDouble(String sInput);
^
7 years ago
Hello,

I am doing an assignment for my Java class.
It asks to 1) Read input from a user. 2) convert the input to a double number if valid 3) find average.
I am trying to convert the String entered by user into a double number using Double.parseDouble.
7 years ago
Uhhh....okay never mind. It is now working o.o
7 years ago