An interesting question came across my mind: If it is possible to convert a percentage to a Grade(A,B,C,D, or an F). Firstly, there is an easy method to convert a percentage to a Grade; by using an If and Else loop. However, are there also other methods with which this can be achieved? Arrays, shiftin bits, etc... It would be very interesting to see if there are any non-trivial methods to this.
Chillawowa
0
Newbie Poster
Recommended Answers
Jump to PostMultiply 100 times your percentage which should be a decimal number? If you elaborate on the purpose of this people be able to think of more ways. There's also a for loop and while loop. Doing an array would also be possible if you gave a list of numbers.
Jump to PostSwitch statements?
They would be the best way to do this, IMO, since you're just considering *one* variable (i.e. the %) and outputting different values (i.e. the grade) depending on that % variable.
All 5 Replies
COKEDUDE
27
Junior Poster in Training
Devoted Hosting
0
Light Poster
Chillawowa
0
Newbie Poster
mrnutty
761
Senior Poster
BestJewSinceJC
700
Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.