Hi,
Here is the code - The program does not provide any message to the user when no argument is pass
[code=java]
public class Hexnumbers{
public static int conv1(String s)
throws NumberFormatExc eption {
String digits = "0123456789ABCD EF";
s = s.toUpperCase() ;
int val = 0;
for (int i = 0; i < s.length(); i++) {...
User Profile
Collapse
-
Java Exceptions
-
Chained Exceptions
Hi,
I have a problem with chained the exceptions. I know the try and catch should be in main method but in this case I have 2 methods and the main method needs to throws an exception
The exception is called NumberFormatExc eption
I need Help..
Code[
public class Hexnumbers{
public static int conv1(String s) {
String digits = "0123456789ABCD EF";... -
Thank you so much is working now .... -
Here is the code for Vehicle class
Can you explain what you wrote about the comparable array, because I still don't get it
code[
public class Vehicle {
private double maxSpeed;
private double price;
private String color;
public Vehicle() {
}
public Vehicle(double maxSpeed, double price, String...Leave a comment:
-
Printing a sort array
I have a problem with printing the array
Here is the print out
Picture a vehicle number 1 : What's it's max speed?
100
Picture a vehicle number 2: What's it's max speed?
20
Picture a vehicle number 3: What's it's max speed?
5
Picture a vehicle number 4: What's it's max speed?
5... -
I am still having problems I don't where to put the object streamLeave a comment:
-
The
Code[
ObjectOutputStr eam o = new ObjectOutputStr eam(new FileOutputStrea m("roaster.txt" ));
Student s = new Student("String lastName, String firstName, String middleName, int sid, double units, String Programs", null, null, 0, 0, null);
o.writeObject(s );
ObjectInputStre am i = new ObjectInputStre am(new FileInputStream ("roaster.txt") );
Student _s = (Student)i.read Object();...Leave a comment:
-
-
My code
[
public class Student{
private String lastName;
private String firstName;
private String middleName;
private int sid;
private double units;
private String Programs;
public Student(){
this( "", "", "", 0, 0.0, "");
}
public Student (String lastName, String firstName, String middleName,...Leave a comment:
-
Read a file
My code
[
public class Student{
private String lastName;
private String firstName;
private String middleName;
private int sid;
private double units;
private String Programs;
public Student(){
this( "", "", "", 0, 0.0, "");
}
public Student (String lastName, String firstName, String... -
I have hard time with arrays can you please help me
[code=java]
public static int conv1(String s) {
String digits = "0123456789ABCD EF";
s = s.toUpperCase() ;
int val = 0;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
int d = digits.indexOf( c);
val += d*Math.pow(16, s.length()-1-i);[/code]...Leave a comment:
-
Here is my code
[code=java]
//LabAssignment2
//Jessica Romero -10-05-07
public class Numbers{
public static int conv1(String s) {
String digits = "0123456789ABCD EF";
s = s.toUpperCase() ;
int val = 0;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
int d = digits.indexOf( c);
...Leave a comment:
-
Calculating the sum of an array with decimal & hexadecimal elements.
I need to add the sum of hex and decimal
right now is not adding anything
A5
165
A5
165A50
FAA
4010
FAA
4010FAA0
Here is my code
[code=java]
public class Numbers{
public static int Numbers(String s) {
String digits = "0123456789ABCD EF";
s = s.toUpperCase() ;
int val = 0;
... -
-
My spelling is correct ... I don't see any problem.... please help meLeave a comment:
-
Employee Class - symbol problem
Hi
I am getting this error message ...can anyone help me out?????
C:\Documents and Settings\Jessic a Romero\Desktop\ Employee.java:2 3: cannot find symbol
symbol : method sethourlySalary (double)
location: class Employee
sethourlySalary (hourlyS);
^
C:\Documents and Settings\Jessic a Romero\Desktop\ Employee.java:2 4: cannot find symbol
symbol : method setweeklyHours( double)...
No activity results to display
Show More
Leave a comment: