• Post Reply Bookmark Topic Watch Topic
  • New Topic

grading system program, no syntax error but got compile errors, can someone wise teach me?  RSS feed

 
Jeffrey Gutierrez
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
' First all of all, hello to all of you, I am new here and plant to stay long computer science, web design and web engineering fascinating, an people with the same passion as me will help alot because we can exchange secrets of it all, and
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.. The purpose of it was to just practice.
running without

heres the code ( don't forget to look at the additional answers before hand.)


---------








~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.
3. Is there any addional books you recommend.


 
Liutauras Vilda
Sheriff
Posts: 4918
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you got some compile time errors, you should be more specific and tell, what errors exactly got. Java compiler error messages usually are very descriptive, if you'd look at them, might you would get an idea, what is wrong.
And concentrate on one problem at a time. At the moment you mixed up everything.
 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What were the errors that you were getting?
 
Jeffrey Gutierrez
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgive me I thought I put it at the end of my post,

heres the compile info.

run:
Student #1 name
Student #2 name
Exception in thread "main" java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Scanner.java:1540)
at gradingapplication.GradingApplication.main(GradingApplication.java:43)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
 
Skye Antinozzi
Ranch Hand
Posts: 68
3
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using the incorrect constructor for Scanner to meet this program's needs. Simply remove the quotation marks around System.in.

This will use the constructor that uses the Input Stream object in rather than a String object.
 
Jeffrey Gutierrez
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you skye, if there was a thank you button i'da just gave you a thumbs up
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch I hadn't realised it was your first posting.

There is a thumbs‑up button. It has +1 written on. It looks like this
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeffrey Gutierrez wrote:If I could get this to work, how would I add a gui?

You don't. you shouldn't. Don't think about the GUI until this work.

Jeffrey Gutierrez wrote: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.

AWT was basically replaced with Swing a long time ago. Both are VERY useful for things other than "spam bots"

Jeffrey Gutierrez wrote:2. the sections where I use the scanner.
this isn't really a question, so I don't know what you are looking for.
Jeffrey Gutierrez wrote:3. Is there any addional books you recommend.
we have a bunkhouse section with book reviews. Many folk around here recommend "Head First Java" if you are a absolute beginner.

Also, just to be technical, that is NOT a compiler error, but a run time error. Your code compiles just find (which you would see if you compiled it on the command line). It is only when you run it that it shoots craps, and throws an exception.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!