I have a task and need to write a program to assist with the scoring of a surfing competition. The organizers at this point are unsure of the exact number of judges or competitors, but they do know that there will be between 2 and 8 judges, and between 3 and 6 competitors. Each competitor is to be given a colour, red, blue, yellow, green, white, or black to compete under. (ie competitor # 1 is red, competitor # 2 is blue, etc. ) The judges enter a score for each competitor, the highest being the number of competitors, the lowest being 1. E.g. if there are 4 competitors, the winning score is 4, second is 3, third is 2 and forth (last) is 1.
If there were 4 competitors, a judges scorecard could look as follows:
Judge # 1
CompetitorRedBlueYellowGreen
Score2143
This ranks the Yellow competitor 1st, Green 2nd, red 3rd and blue 4th or last.
At the end of the day, the organizers would like to be able to summarise the scores as follows:
A histogram of the number of first places that each competitor scoredA table of preferences that shows the number of times each place was awarded to the competitors (ie if competitor Blue was ranked second by three judges, the number 3 should appear in the table for 2nd place for the Blue competitorTotal scores for each competitor.
They would also like to be able to print out the raw data of the final scores. Your program should verify all data entered to ensure that only correct data types with in the expected ranges are entered. Your program should also give users the opportunity to choose how they wish to look at the data, and give them the option of looking at it more than once.
Judges are scoring divers and I need to create a table of scores for each diver given by 7 judges. In the second for statement, I want
Java Code: for(int column = 0 ; column < judges[row].length ; column++) mh_sh_highlight_all('java'); to be Java Code: diver[row].length mh_sh_highlight_all('java');
Instead of judges. Because the total number of divers would like exceed the number of judges, and I believe this is limiting the number of columns to the number of judges. When I use divers though, an error occurs, saying that "int cannot be dereferenced".
Java Code:
public float inputValidScore(){ int Num_Judges = 7; System.out.print("Enter number of contestants: " ); int diver = input.nextInt(); float [] [] judges = new float[Num_Judges] [diver];
[Code] ....
The above is just a method within the rest of the code.
Many classes calculate a final grade by using a weighted scoring system. For example, "Assignments" might be worth (weighted at) 40% of your final grade. To calculate the portion of the final grade contributed by the Assignments category, the teacher takes the average of all assignments in the category and multiplies it by the weight (40%). So if a student averaged 90% on all assignments, the teacher would take 40% of 90%, or 36 as the weighted average score for the assignment portion of the the final score. The teacher then calculates the weighted average score for each of the other categories (Quizzes, Midterm Exam, Final Exam, etc.), adds them all together to come up with the final score, and assigns a letter grade based on that score.
Write a Java program that allows the teacher to calculate the grade for a student.
Specification :
Prompt the user to enter the Student ID number, first name, last name, and the average score for each of the following categories:
I want to develop a Java program that uses OpenScript APIs to test my applications. The OpenScript framework automatically creates the Java Code so I was thinking of either using this code or create my own using the APIs.
I tried both options using NetBeans but I'm getting errors everywhere starting with the library import. I'm pretty new to Java so I'm sure I'm missing a lot of things here. I pasted the code below from the OpenScript framework that want to use in a stand-alone file for your reference.,
i have made a phone directory and i have also maintained a database for this. i want on clicking the next button each row from database table display one by one on the GUI into their relevant text Fields. i have written this code , this code show the last row of the table on single click on next button. i want one by one row on each next button click.
you will be making four variables (2 primitive integers and 2 Account Objects). You will be following the steps detailed below. The challenge is to understand exactly what is happening and why. Start by coding the following two methods in a java file.
Static methods: This method can be called whatever you want, however it will be public, static, and void. This method should take in four parameters: w and x which will be integers, then y and z which will be Account Objects.The first thing this method should do is to print out the four variables w, x, y, and z. This should be done in the same manner as you did in the main method. Next, change the first variable (w) to 15. After that, ted bought a new car. He now has only $20,000 in his account. Change the balance of y to be 20,000. Step three is to make a new Account Object named John, he has a balance of $10,000. Assign him to the variable z. Lastly, print all four variables again: w, x, y, and z.
We recently upgraded to JDK 8. Since then, a section of code in a jsp file breaks. The code is this:
ArrayList all = new ArrayList(); final List tsd = timeSeriesBean.getTSData(); all.addAll(tsd); Collections.sort(all, new Comparator() { public int compare(Object o1, Object o2) { TSData t1 = (TSData)o1, t2 = (TSData)o2; int res = t2.getDate().compareTo(t1.getDate());
[code]....
The error message is this:
An error occurred at line: 65 in the jsp file: /TS/VerifyImportTSData.jsp The type new Comparator(){} must implement the inherited abstract method Comparator.thenComparing(Function, Comparator)
64: 65: Collections.sort(all, new Comparator() { 66: public int compare(Object o1, Object o2) { 67: TSData t1 = (TSData)o1, t2 = (TSData)o2; 68: int res = t2.getDate().compareTo(t1.getDate());
just trying to maintain some old java code that I can support until it is rewritten.
i want to use cucumber in java through code. previously i have used it with Junit. but now i need to implement it through coding for the purpose of automating.
I have a new user on my website - it's password protected etc. and I'm just giving them the initial walkthrough. I have a java applet that plots charts and when he goes to this page he gets no chart and at the bottom of the pages there's a bar with the message "Internet Explorer blocked this website from installing an ActiveX control. What's the risk?" and then there's a button to say Install.
I said, it's just for you to permission running the java applet but his IT guy is saying that java doesn't trigger warnings about ActiveX controls so he's nixing the approval.
I have to write Scanner and Parser for the C-Code based on Java and obtain Abstract syntax tree(AST) . I am allowed to use tools like ANTLR, CUP. But i should be able to expand all macros in my code to its basic low level data type like int, boolean and whats the best approach?How to start initially?
In fact, I'm not yet past that "Hello World" program.I'm following the steps in "Head First: Java" book, and reached that point where one is ready to write his/her 1st Java code. Here's mine:
public class MyFirstApp { public static void main (String[] args) { System.out.println("I Rule!"); System.out.println("The World!"); }
}
As simple as it should be, and compiles fine producing the correspondent class. But it doesn't run, however, and spits the following execution-time errors:
Exception in thread "main" java.lang.UnsupportedClassVersionError: MyFirstApp : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
I need to access a method from a dll in java as below and is giving an error
"Exception in thread "main" java.lang.UnsatisfiedLinkError: Testdll.Decrypt(Ljava/lang/StringLjava/lang/String; at Testdll.Decrypt(Native Method) at Testdll.main(Testdll.java:31) " I have included the jna-4.0.0.jar and the HashMatchCryptography.dll to the project in eclipe and the java-library-path has the path for the lib
My method below works fine to print a matrix but when it prints every row, it is printing extra 4 white spaces which is not required. How can I delete those extra spaces at the end? when I use
Why can't I see the text when I compile the java code?
Java Code:
import java.io.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.*; public class WorldTravel { public static void main (String[] args){ JFrame f = new JFrame("World Travel!"); BG_text p = new BG_text();
I have written a code to get all the nodes below a current Node and it is working but I need to get it to look better if possible. To get the number of nodes below I have created an Array List, which I then go to the first Node below and add all the people to the Array list on the same level till I get to the end of the level, then I go down again until I cannot go down any more. Is there a way I can have my code without having to use an array List? I have put my code below. The brieff about the tree is that you have a parent and below the Parent are children who can have brothers and sisters next to them and after that they also have children below that. The method is trying to find the number of children below any given child
private LinkedList<Node> TempQueue = new LinkedList<Node>(); public int noOfYoungerChildren(Member p1){ Node tmp = find(p1); return countYoungerChildren(tmp);
InputStream inputStream = null; OutputStream outputStream = null; try { URL url = new URL(imgfm); inputStream = url.openStream(); outputStream = new FileOutputStream(imgto); byte[] buffer = new byte[2048]; int length;
[Code] ....
I have several pic to download (e.g 30) however, the code work for some pic (workable for a random number of pic, sometimes workable for 10 pics but sometime can only download 1 pics).
I try to input several println code to found out the problem. finally i found that all the code stop (it's stop as when i use debug process in eclipse, it get no respond) and the final appear code under console is:
I am working on project "Abstraction of UML diagrams from java code". I am searching for a at least few codes to create class, object, sequence, activity, usecase diagrams.
if the above code is to launch another application using java then how can I close/exit the same(another) application using java code once I press the exit button of my java app.
I am trying to figure out how to simulate an ability score calculation for an RPG character creation. The way I want to do it is to have 5 d6 dice rolled and then the best three of the 5 rolls are added together for a maximum of 18 points and a minimum of 3 points.
Now I know how to generate random numbers, but I do not know how to have the best 3 picked out. What I have right now is super simple.
package javaapplication12; import java.util.Random; public class JavaApplication12 { /** * @param args the command line arguments */ public static void main(String[] args) {
[Code] ....
So this gives me my five rolls but then have the code pick out the best three every time the program is run is kind of an issue for me.
I have a java project in Eclipse. I make changes to this project from different computers. I think this is a good opportunity to learn and practice some source control. Is there a source control system which will allow me to do this very easily ? How about Git ? Any outline of the main steps needed to setup this thing with Git, preferably within eclipse itself ? I don't need each and every step to prepare the whole system. I only need the main steps like - download and install git on both machines, rent a server and create a repo on it, grant both computers access to the server etc.