I compiled a java program and converted it to an exe file and it works fine on the computer I created the java file in but when i try it on another computer it gives me a "Java Virtual Machine Launcher - A Java Exception has occured" error message.
I'm converting from ASP to Java for a legacy site. I believe the first part of the if statement is right but I'm having an issue within the else staetment. I'm getting date is undefined, I've tried using getYear and getDate but have not been successful.
ASP:
If Request("action") = "results" Then aMonth = Request("selMonth") aDate = cint(Request("selDate")) aYear = cint(Request("selYear")) Else aMonth = UCase(MonthName(Month(Date()),true)) aDate = Day(DateAdd("d",-1,date())) aYear = Year(Date()) End If
I am trying to use a for loop for getting hours for an employee for five days. how to convert my pesodocode into java language so that it will compile. This is what my pesodocode looks like:
begin getHours() for(index=0; index <5; index++) get hours **System.out.println() **inputString = input.readLine() **plumbersHours[index] = plumbersHours [index] = integer.parseint(inputString) endfor index = 0 while (index < 5) totalHours + = plumbersHours[index] index++ end while return
I am trying to Extract the ranges of Variables from a Text File. I extracted lines of the forms X in 1..10 Y in 12..50 Z in 0..19 / 66/ 95..100 Where X in 1 ..10 states that X takes values from set 1 to 10 Similarly for Y and for Z its a Union of different ranges of the values (0 to 19, union 66,union 95 to 100)
I want to Map these Variables to their respective sets using Hashmap where Key is Variable name and value will be a Set. My Hashmap Signature is HashMap> hm=new HashMap>();
how to use Java and for my coursework I have been asked to construct an application that will read in the exam mark and coursework mark and then print out to 1 decimal place the average of the coursework and exam mark. When I submit it to the coursework submission system it says it's incorrect.
The answer that it's asking for is the answer that my code produces (ex = 71 cw = 40 mark = 55.5) But for some reason it says this when I submit it:
-#### << Differences between expected (<) your answer (>) >> ------------ 1c1 < ex= 91 cw = 80 mark = 85.5 --- > ex = 71 cw = 40 mark = 55.5 -------------------------------------------------------------------------
Check the above output for why this attempt failed And when I change the ex to 91 and cw to 80 it asks for > ex = 71 cw = 40 mark = 55.5 again.
class Main { public static void main( String args[] ) { int ExamMark=71; int CourseworkMark=40; double cost = (double)(ExamMark + CourseworkMark) / 2; System.out.printf("ex = " + ExamMark + " cw = " + CourseworkMark + " mark = " + cost); System.out.println(); } }
I am trying to create a program that allows me to enter 5 students numeric grade (0-100) to a letter grade (A, B, C, D, F) and I CANNOT use an array. When I try to run my program it says main class not found, and when I change the it from a string to a void in the main method it does not work.
Java Code:
import java.util.Scanner; public class Week3ControlStatements2 { public static String main(String[] args){ int numberGrade = 0; int quotient = numberGrade / 10; int remainder = numberGrade % 10;
I am trying to write a program for converting positive binary inputs into hex. in the hex output the point (".")is missing.
Suppose my expected output is e7.6 , but i am getting e76
only the "." is missing.
here is my BinToHex class..
import java.io.*; public class BinToHex { double tempDec,fractionpart; long longofintpart,templongDec; String input ="11100111.011"; String hexOutput=null,tempDecString,hex = null; static int i = 1;
I'm using jdk7 and I get this error when I compile Exception in thread "main" java.lang.Error: Unresolved compilation problem: at First.main(First.java:16)
I'm trying to run an enterprise java application running glasssfish server from my university ( the open university, distance learning and i recommend it). I get the following error:
The Java EE server classpath is not correctly set up - server home directory is missing.Either open the project in the IDE and assign the server or setup the server classpath manually.For example like this: ant -Dj2ee.server.home=<app_server_installation_directory> BUILD FAILED (total time: 0 seconds)
package Week_8; import java.util.Scanner; public class Task_1 { public static void main(String[] args) { Scanner kboard = new Scanner(System.in); int customer_number; String customer; int items; char category;
I am currently trying to split the string "EAM est" between the part. I have gotten the code to work if the was a -. But I can't see why the error is occuring
I have a JSP page that calls a Java method .. using GlassFish 4.0 it worked just fine, now I'm trying to run it on a new server with Tomcat 6.0 but it keeps giving me this error: "the function result must be used with a prefix when a default namespace is not specified"
I am having trouble figuring out why java is giving me an error for the symbols. I will post the errors below the code.
Java Code: import java.util.Scanner; public class ShelbyHarms_3_02 { public static void main(String[] args) { Scanner console = new Scanner(System.in);
public static void main(String[] args) throws FileNotFoundException { // create data file to read from File inf = new File("cityPopulationData.txt"); //Create a file to write out to. PrintWriter fileOut = new PrintWriter("output.txt");
[Code] .....
This is my error
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:909) at java.util.Scanner.next(Scanner.java:1530) at java.util.Scanner.nextInt(Scanner.java:2160) at java.util.Scanner.nextInt(Scanner.java:2119) at PA9.getData(PA9.java:35) at PA9.main(PA9.java:22)
I am trying to uncover why I am getting an error message when trying to view a panoramic photo on my wordpress website.We are using the PTviewer plugin.This is the error message when you load the page: URL....I recently took over as webmaster for this site am not sure how the previous developer decided to set this up.Here is the raw code:
<div style='padding: 15px'><h2 style='font-size: 13pt; color: #DB592D; margin-left: 5px; margin-bottom: 5px; font-family: georgia;'>Spacious One & Two Bedroom Suites</h2><p style="">Stay & Play at Pacific Plaza and your stay will be filled with fun, excitement in a relaxing beach atmosphere.<p style="">Choose from our spacious one bedroom and two bedroom suites.
I have an error using quicksort and this is a project ... The error occurs for numbers such as 7500 and bigger ...
Exception in thread "main" java.lang.StackOverflowError at QuickSort.QuickSort(QuickSort.java:45) at QuickSort.QuickSort(QuickSort.java:46) at QuickSort.QuickSort(QuickSort.java:46) ...
Java Code:
import javax.swing.JOptionPane; public class QuickSort{ public static void main(String[] args){ int p=new Integer(JOptionPane.showInputDialog("Jepni numrin e kufizave: ")); int[] ListaNumrave= new int[p]; //QuickSort Zbrites
I've got a problem in Eclipse. The below code is a part of my program, used for (re)starting a new game. The 'public static int' statement gives the error 'This method must return a result of type int'..
public static int playAgain(){ boolean validInput = false; do { System.out.println("Would you like to play a game? Please answer 'yes' or 'no'."); String playAgain = input.next();