Grading System Program - No Syntax Error But Got Compile Errors
May 23, 2015
Netbeans do not detect any syntax errors, but I when I check the build it retuned areas they were a few; It's a simple program name 5 people, gade them then do final calulatoins it's called "grade tool.
heres the code
package gradingapplication;
import java.util.Scanner;
public class GradingApplication {
public static double score(double score){
if(score >= 90){
System.out.println("A");
[code]...
~Problems~
1. It has no gui, I don't know java fx, is java groove used? awt is useful for creating spam bots in robot class, I know it's not very useful but it's so much fun.
2. the sections where I use the scanner.
View Replies
ADVERTISEMENT
Aug 20, 2014
Ok so this is a grading program. I have it so the user can input 2 students and then at the end using an if statement it is suppose to compare them and print out who had the higher grade. Seems simple but it never runs the line of code to print out whos grade is higher:
if (stuAverage > stuAverage2 ){
System.out.println(student + " has the highest grade of all students entered!");
}
else if (stuAverage2> stuAverage){
System.out.println(student2 + " has the highest grade of all students entered!!");
}
Here is the Main class:
import java.util.Scanner;
public class Main2 {
int stuAverage;
static String student;
[code]....
View Replies
View Related
Nov 29, 2014
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:
Assignments (worth 50%)
Quizzes (worth 20%)
Midterm Exam (worth 10%)
Final Exam (worth 20%)
Calculate the weighted average score for each category and the total score for the student. Next assign a letter grade as follows:
90 - 100 = A
80 - 89 = B
70 - 79 = C
60 - 69 = D
59 and below = E
Print the results in the following format:
Name: [Last Name], [First Name]
Student ID: [Student ID]
Assignments: [weighted average]
Quizzes: [weighted average]
Midterm Exam: [weighted average]
Final Exam: [weighted average]
Total: [total score]
Final Grade: [letter grade]
Prompt the user to either enter another student or to quit. Continue the process until the user chooses to quit.
I almost done everything but I cant calculate a total score for the student or Assign a letter grade based on the score!!!!
package teacher_grade;
import java.util.Scanner;
public class teachergradeing {
public static void main (String[] args) {
//Scanner objective
[Code] ....
View Replies
View Related
Apr 4, 2014
The first 4 class below are the main classes while the last class is the testing class. I got it all to compile but for whatever reason there are several runtime errors. I have spent hours trying to figure out what they are, but I was only able to eliminate a few.
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Set;
import java.lang.*;
public class PhoneNetwork {
[Code] .....
View Replies
View Related
Apr 5, 2015
Getting the following error at line 13.
Multiple markers at this line - void is an invalid type for the variable loadDictionaryFromFile - Syntax error on token ")", ; expected - Syntax error on token "(", ; expected
Line 13 starts public void load....
Code:
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class PirateTranslator
{
public static void main(String[] args)
[Code] .....
View Replies
View Related
Sep 25, 2014
on my note pad the 00 means that it is an excused absent while 0 is the unexcused:this one is the readfile saved on .txt
Bruce Wayne
9 9 00 19 49
10 0 10 9 9
90
50
87 87
some of the code:
if (inFile.next() == 00){
System.out.print("student has an excused absent how would you like to proceed");
}else{
grade = inFile.nextDouble();
qsum += grade;
View Replies
View Related
Mar 14, 2014
Write a java program that calculate the grade point of three subjects and their credit hours through if the grade points and the credit hours are
Subject---grade---gradepoint-----credit hours
Maths------A--------4.0---------3
English composition-----B-------3.0-----2
French-----B+ ---- 3.3----------3
Now,if the grade point is equal to 4 ,print out First class
If the grade point is equal or greater than 3.0 but less than 4,print out Second class upper
If the grade point is equal or greater than 2.0 but less than 3,print out second class lower
Use the if-else-if statement
View Replies
View Related
Dec 23, 2014
i wrote this program:
class hellojava
{
public static void main(string[] args)
{
system.out.println("hello java");
}
}
Then i saved this file with name hellojava.java(notepad) in C drive in separate folder c:myjavaapp(not in c:java folder).
When I am compiling(with javac hellojava.java) it shows following error:
cannot find symbol public static void main(string[] args), and also says package system doesnot exists system.out.println("hello java");
View Replies
View Related
Mar 19, 2014
I am making a simple mod/hack for a game programmed in Java. I located the .class file I needed and deobfuscated it and then decompiled it. After that I went in and made a very simple adjustment that I wanted to make. Unfortunately I can across a problem when trying to compile the file! The file won't compile because there are errors. The reason there are errors is because this is just one file out of an entire game. I know this my seem weird, but is there some way I can compile the file with the errors.
View Replies
View Related
Jan 24, 2015
numHitslocs
public class simpleDotCom {
int numHits=0;
int[] locationCells;
public void setlocationCells(int[] locs){
locs=locationCells;
[Code] ....
View Replies
View Related
Sep 26, 2014
i have a similar problem but what i need to do is to detect an exused absent of which in my notepad is represented by 00 and 0 being an unexcused absent, anyway if a student has an excused absent example a quiz for that day will be deducted from the total quizzes example if i was the teacher and had 2 quizzes of 10 items each and she was absent in one of the quizes instead of let say her score was 9 on the first quiz it should go 9/10 and if it was an unexcused absent 9+0/20 anyway this is my java code and notepad example
import java.io.*;
import java.util.*;
import java.lang.*;
public class GradingSystem {
public static void main (String[] args) throws FileNotFoundException
[code]...
View Replies
View Related
Dec 13, 2014
This is what i have so far, I use BlueJay to write this:
import javax.swing.JOptionPane;
public class payroll
{
String again = y;
//
private String name;
private double rate;
private double hours;
static double gross; //gross pay
[code]....
my first problem is that it expects a ")" on this line :"if ((hours <=40)rate *1);"For the assignment itself these are the requirements:
-Create a class called payroll with private variables for rate hours and name
-Create static variables for gross pay, union dues, health coverage (hp in my case), FICA taxes, State taxes, Federal taxes, net pay, all must be initialized to 0
-default constructor that assigns default values
a function called calcPay that will do the following tasks and print it to a pay stub :
- function that checks the hours ( if hours are 40 or less pay rate, if over 40 pay 150% of the rate)
- calculates gross pay before any deductions (using user inputted hours and rate)
- deduct medical coverage and union dues from gross pay and call this adjusted gross pay (also this should have its own line on the paystub)
- A function that deducts State, federal and fica taxes from adjusted gross
- FICA - 7% for any income
-Federal - 2% for $0-$150 / 6% for 150.01 - 300 / 14% for 300.01 - 600 / 18% for 600.01 - unlimited
-State - 1% for 0-150/ 3% 150.01 - 300 / 5% 300.01 - 600/ 8% 600.01 - unlimited
- amount after all deductions is the net pay ( show this amount on its own line)
- Start a loop that asks each time if there are more employees (y/n) y should continue the program and n should end it
-dialog boxes should be created to recieve values for name, hours and rate
- if the rate is entered below $8 dollars a new box should pop up and ask for a higher value
- When there are no more employees, print out a summary of quantities stored in static variable (also had a problem with this)
- End
So I think i completed most of these objectives but am having trouble with the syntax and some of the objectives
View Replies
View Related
May 12, 2014
So my only error in the entire code is on the 9th line of this code sample. It says "Syntax Error on token "new", @ expected" but @ does not belong there, as far as I can tell, since the error does not go away upon adding it.
public class Obstapacalypse implements KeyListener, ActionListener {
private static final String EXIT_ON_CLOSE = null;
private JFrame frame;
private Player player = new Player();
private JPanel contentPane;
private JButton btnStart;
[code]....
View Replies
View Related
Oct 6, 2014
Write a program to request a student number and their marks in 4 subjects. The program must print the student number, total marks and average mark. All outputs should be printed with suitable labels
This is the error am getting
Scanner get = new Scanner (System.in) - got a red line
int student number, total marks, average mark - got a yellow bulb with a red exclamation mark on it.
I just dont understand where the errors is where what the system dont have ... I am using netbeans ....
View Replies
View Related
Jun 4, 2014
My issue is that when I run the code if I enter anything but 1, 2, or 3 the code breaks. I have spent hours trying to find the error. here is my code
import java.util.Scanner;
public class Tester {
public static void main(String[] args) {
/**
* constructor
* pre: none
* post: inherit values of other classes
*/
Car Car = new Car(); //inherits the properties of the Car class
Truck Truck = new Truck(); //inherits the properties of the Truck class
[code]....
View Replies
View Related
Mar 9, 2014
I'm not sure why I'm getting these errors. They only begin to happen after the second if statement, and the subsequent if statements are formatted exactly the same.
The errors are marked by the comments in the code.
Java Code:
import java.util.*;
import java.io.*;
public class GazillionSongs {
public static void main(String[] args) throws FileNotFoundException {
System.out.println("Welcome to Java Song Collection!");
System.out
.println("This program sorts and filters large databases of popular songs.");
[Code] .....
View Replies
View Related
Sep 14, 2014
My if else statement is not working...it keeps telling me that the else in the statement is a syntax error and that I should remove it. Whats wrong with it?
package Homework2;
import java.util.Scanner;
public class Homework2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Welcome to the Triangle Program.");
[Code] ....
View Replies
View Related
Jun 22, 2014
I have a problem with my code. It gives me the error I put as title:
backgroundA.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
if (j < 2){
int randomInt1 = random1.nextInt(Deck.length());
int drawableIDA = Deck.getResourceId(randomInt1, -1);
[Code] ....
This error is in the first line and I have also one in the last, where eclipse looking for a @ (O.o). Also I will insert the variable choice1.
final Button choice1 = (Button) findViewById(R.id.A);
View Replies
View Related
Jun 22, 2014
I have a problem with my code. It gives me the error I put as title:
backgroundA.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
if (j < 2){
[Code]...
This error is in the first line and I have also one in the last, where eclipse looking for a @ (O.o). Also I will insert the variable choice1.
final Button choice1 = (Button) findViewById(R.id.A);
View Replies
View Related
Jul 14, 2014
I am following this article : [URL] ....
And I have created 4 different types of Interfaces and Classes
Interface:-Flyer,Mythical
Class:-Horse,Pegasys.
But on Interface
I am getting error on line
default public String identifyMyself()
"Syntax error on token "default" delete this token"
Here is code for all 4 interfaces and classes
public class Horse {
public String identifyMyself() {
return "I am a horse.";
}
}
public interface Flyer {
default public String identifyMyself() {
[Code] ....
View Replies
View Related
Sep 25, 2014
I am currently working on modules of a java program but am having issues with this module . it gives this error code"syntax error on token '?', invalid primitive type".
This is my code:
import java.awt.*;
import java.awt.event.*;
import java.io.PrintStream;
import java.rmi.Naming;
import java.util.StringTokenizer;
[Code] .....
View Replies
View Related
Apr 11, 2015
this is a syntax error within Jasper reports in the printwhenexpression property.I can use the following expression successfully: new Boolean ($F{off_peak_free_minutes}. trim().equals("")==false) - this basically tells Jasper Reports to ignore the column unless it has a value.
Now I'm trying to do the same thing with ZERO but I can't get the syntax right. I've tried: new Boolean($F{off_peak_free_minutes} != 0) but the ZERO comes up with a red underline implying that this is illegal.I've also tried: new Boolean($F{friends_family_minutes}!=Double.valueOf(0)) but the ZERO comes up with the red underline.
I suspect I'm just not specifying the JAVA right. I believe that the $F{friends_family_minutes} variable is a DOUBLE - it prints as 0.00 on the report.
View Replies
View Related
Jul 19, 2014
I am trying to insert a record to a table in my database . I used the same syntax for 2 tables, one does work and the other does not work . I could not find any explanation for this error
"INSERT INTO CustomerRecord (Name, Number, Adress)"
+" VALUES(?,?,?)"; //first table working well
ps.setString(1,r.getCustomerName());
ps.setString(2,r.getCustomerNumber());
[Code] ....
For some reason one does work but the other does not work it says syntax error near order (table name). I am using sqlite db ...
View Replies
View Related
Apr 29, 2015
In the current program I am trying to read multiple text files from a folder. I keep getting the following syntax error
"Syntax error on token ";", { expected after this token".
I highlighted the line where im getting this error in red.
import java.io.*;
import java.util.*;
public class CacheData {
// Directory path here
String path = "C:myfiles*.txt";
[Code] ....
View Replies
View Related
Feb 9, 2015
I am a C# developer but need to do some java development. The code produces the following error.
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
...
HashMap<String, String > myMap = new HashMap<String, String>(){{
put("a","b");
}};
myMap.put("foo", "bar");
myMap.put("Sna", "foo");
...
Generates this error
C:/FSC/apache-tomcat-6.0.41/webapps/aspen/temp/x2_8656248460570782763/x2_5214718769032742331/StudentExport.java:47: error: <identifier> expected
myMap.put("foo", "bar");
^
What am I missing?
View Replies
View Related
Jul 23, 2014
programming altogether and after almost reaching half way in the 'Head first java' book I decided to try and apply some of what I've learnt so far and write my first 'Object orientated' program. As this is pretty much the first program I've ever written, I decided to write a program to ask for two integers and add them both together and then present them to the user (the goal eventually being a basic fully working command line calculator with +,-,* and /. I'm expecting many compile errors but not the following errors below.
I have three .java files contained within a folder and after trying to figure out how to compile all three files (as they use one another) all at once, I came across this ---> javac *.java
so I typed this in the command line whilst in the directory containing the three files assuming *.java is the best approach and then I receive the following errors:
inputOutput.java:10: error: cannot find symb
c.addition() = intIn.nextInteger();
^
symbol: variable c
location: class inputOutput
[Code].....
View Replies
View Related