Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
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.


 
Marshal
Posts: 6974
471
Mac OS X VI Editor BSD Linux
  • 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.
 
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)
 
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
 
Marshal
Posts: 65098
247
  • 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
 
lowercase baba
Posts: 12754
51
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!