MajorGeeks Support Forums IOBit Software

Go Back   MajorGeeks Support Forums > Majorgeeks.Com - Support Forums > Programming
Register FAQ Members List Calendar Casino Mark Forums Read

Programming Place to discuss programming including HTML, Java, C++, MySQL and others.


 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-18-07, 01:49
keith23 keith23 is offline
Private E-2
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to make a working Program. Don't know how to build it. It should be easy

Tomorrow I have an exam that requires that I know how to read inputs from a text file and display results. I was given an assignment, that If I can solve it, will help me with tomorrows exam. I don't expect anyone to help me write this. But whoever does, Thanks a lot. It's not suppose to take long at all to write. I just can't get it figured out. The assignment is as follows:
Problem 1 part a: Create the following text file ("Week9.txt"), which states exactly as written:
78 George
90 John
97 Alex
80 Thomas
75 James
87 Andrew
55 Frank
82 Anna
91 Maria
74 Anton
92 Carolina

Problem 1 part b: Write a program that reads data from the file "Week9.txt" and displays:
The Person's name, his/her score and comment: "good job", if the score is at least 80, "work harder", if 60<=score<80, "see your teacher", if score<60.
The Person's name with highest score
The Person's name with lowest score
The average score


Additional Details

the programming language I'm using is Java, and I use JGrasp to run it.

Also this is the code I came up with


import java.io.*;
import java.util.*;

class ReadName
{
public static void main (String args []) throws IOException
{
String name;
int score;
Scanner inFile=new Scanner (new File ("Week9"));
while (inFile.hasNext();
}
inFile.close();
System.out.println();
}
public static findGrade (int n)
{
String a;
if (n>=80)
a="good job"
else if (n<80&&n>=60)
a="work harder";
else
a="see your teacher";
return a;
}
}
Reply With Quote
Sponsored links
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for easy & free word processing program GrammawNewbie Software 6 01-10-07 15:32
I Need A Easy To Use Newsletter Sending Program!!! superstar Software 5 09-09-06 17:35
easy way to make a dvd jarfark Software 6 10-01-05 21:51
How to make MyIE2 default browser / FlashGet not working alanc Software 4 09-30-03 07:07


All times are GMT -5. The time now is 20:04.


MajorGeeks.Com Home Page
| Admin Tools | All In One | Anti-Spyware | Anti-Virus | Appearance | Backup | Benchmarking | BIOS | Browsers | Covert Ops |
Data Recovery | Diagnostics | Drive Cleaners | Drive Utilities | Drivers | Driver Tools Ergonomics | Firewalls | Games | Game Tweaks | Graphics | Input Devices | Internet Tools | Macintosh | Mail Utilities | Memory | Messaging | Monitoring | Microsoft | Multimedia | Networking | Office Tools | Process Management | Processor | Registry | Security | System Info | Toys | Video | Miscellaneous
|

-->
Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger