473,371 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,371 software developers and data experts.

writing a java program

a program that expects a numeric grade as input and outputs the corresponding letter grade. the program uses the following grading scale:
numeric range letter grade
0 39 E
40 49 D
50 56 C
57 63 C+
64 70 B
71 77 B+
78 84 A
85 100 A+

required to use compound boolean operators
Sep 3 '07 #1
5 4059
Nepomuk
3,112 Expert 2GB
a program that expects a numeric grade as input and outputs the corresponding letter grade. the program uses the following grading scale:
numeric range letter grade
0 39 E
40 49 D
50 56 C
57 63 C+
64 70 B
71 77 B+
78 84 A
85 100 A+

required to use compound boolean operators
Hi Arishma! Welcome to TSDN!
Check out the java.util.Scanner class for reading in your numeric value and then find the correct Letter for it. If you're new to Java, check out this article - it will teach you, what you have to know to solve this problem.

Greetings,
Nepomuk
Sep 3 '07 #2
nickyeng
254 100+
hi,

why not you give some code that you've done to show us what you've got so far..

but you seems like asking ppl giving you the code...

:p

from
Nick.
Sep 4 '07 #3
Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2. class testscore {
  3.     public static void main(String[] args) {
  4.  
  5.         int testscore;
  6.         char Grade;
  7.              char Grade;//To print the student grade on the screen
  8.  
  9.        if (testscore >=0 && testscore <= 39) 
  10.             System.out.println( "E" ) ; 
  11.          if (testscore >= 40 && testscore <= 49)
  12.             System.out.println( "D" ) ;
  13.         if (testscore >= 50 && testscore <=56) 
  14.             System.out.println( "C" ) ;
  15.          if (testscore >= 57 && testscore <=63)
  16.             System.out.println( "C+" ) ;
  17.         if (testscore >=64 && testscore <= 70)
  18.             System.out.println( "B" ) ;
  19.       if (testscore >=71 && testscore <= 77)
  20.         System.out.println( "B+" ) ;
  21.       if (testscore >=78 && testscore <= 84)
  22.            System.out.println( "A" ) ;
  23.      if (testscore >= 85 && testscore <= 100)  
  24.         System.out.println( "A+" ) ;
  25.  
  26.  
  27.         return Grade;//method to return student grade                    
  28.                        }
  29.  
  30. }
  31.  
this is what i have got but 1 error where help pliz
Sep 6 '07 #4
thanx a ton i think i have got it now
Sep 6 '07 #5
Nepomuk
3,112 Expert 2GB
thanx a ton i think i have got it now
Well done for finding it!

One little tip:
When you ask for help next time, don't just state, that there is an error, but also tell us, what error it is (what it is called, e.g. NullPointerException, IOException, ...) and in what line it occurs (the compiler will write something like
Expand|Select|Wrap|Line Numbers
  1. Exception in thread "main" java.lang.NullPointerException
  2.     at java.io.FileInputStream.<init>(Unknown Source)
  3.     at yourProject.yourClass.main(Exceptions.java:12)
  4.  
and then 12 would be the line you're looking at).

Greetings,
Nepomuk
Sep 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: SomeDude | last post by:
Hi, I have a question on file writing. I am not very experienced in Java programming. My hobby right now is to write an applet where 2 persons could play Go together (it is a board game). The...
1
by: GM | last post by:
Hello. I am starting my 7th week of an intro to programming class and have a problem I have been working on. My instructor said we could look for source code on the internet and use it as long as...
48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: Von Clubusev | last post by:
I like Java just as much as I like C#, but the truth is that unless you absolutely need platform portability, DotNet is the way to go. This is becoming even more true with the release of Windows...
2
by: Luc The Perverse | last post by:
I am a Java programmer - but I have had some experience programming in C++ before (3 years on a job) I have need of an application or set of applications to do the following on a windows...
6
by: ahin | last post by:
can any one help or give an idea about writing or from where to strat the following program? Load a list of available courses from a text file into an array (max 4 courses). File format can...
2
by: toprahman | last post by:
Hi guys, I'm a student teacher at a high school in Washington D.C. and I've come across a slight problem. See, I'm a math major, but one of the computer science teachers just quit and they need me to...
7
by: rohitsripathi | last post by:
i need help writing this program... i am in college and i do not have time do this right now as i need to study for another test....but this is due tonight...i will pay $5 if you accept to do it and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.