Abdallah Taha

Ranch Hand
+ Follow
since Sep 16, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abdallah Taha

Campbell Ritchie wrote:

Abdallah Taha wrote:. . . By using my code, if I use the file containing your data I got a average 51.

How did you manage that? The correct average is 60¼. If you use integer arithmetic, that will come to 60


Thanks for all, I found the correct average 60.25 with this :
2 days ago
I did like this :
2 days ago

Piet Souris wrote:But I would expect a file with content like:

How else can I calculate an average?



By using my code, if I use the file containing your data I got a average 51.
2 days ago
Maybe I didn't understand the assignment but I created my file from this sentence "after processing the entire file compute the average grade and return the equivalent letter grade as a char value (A = 90-100, B=80-89, C=70-79, D=60-69, F=0-59)", I think the file will be like this :
A = 90-100
B = 80-89
C = 70-79
D = 60-69
F = 0-59
2 days ago
There is not students name just because I understand from the question "reads a file containing students’ numerical grades–one grade per line." So I don't think that I have to create a student name. Also the sample out show "The average grade is B."
2 days ago
My file looks like this :

A 90-100
B 80-89
C 70-79
D 60-69
F 0-59

Refered to the question which ask to create a file and then one grade per line. Is my file correct?
2 days ago
I'm working on a project that reads a file containing students’ numerical grades–one grade per line. I did create the file.
I'm fine with opening the file but I'm struggling with how to get it to read the average of the first line then continue to all the other ones as well returning the value in the println. I know the result which is the average grade is B.
My program should not assume that I know how many lines of data are in the file.
The letter grade as a char value (A = 90-100,B=80-89,C=70-79,D=60-69,F=0-59). Any suggestion, Thanks.



3 days ago
I'mlooking to do Fred values  42,492.34 minus Sally values 18,230.12.
42,492.34 - 18,230.12
Do I need to do an array two-dimension to do this calculation.
1 week ago
Thank you,
I want to add Fred number to Sally?
1 week ago

Knute Snortum wrote:Well, you're not reading the entire file into an array, just one line at a time.

Are any of the fields in the data quoted?  Like..

10, "Snortum, Knute", 13.32

In the line above, there are only three fields and the second field is "Snortum, Knute".  If you have data like that, I'd suggests using Apache's Commons-CSV.


Yes, it like that.  

Fred Jones 42,492.34 1 A 2,218.23
Sally  O'Brien     48,721.66 2 i       18,230.12

1 week ago
I'm looking at how to process each line of data, print the results for that person, then read the next line. Without reading the entire file into an array before processing the data I need suggestions.
1 week ago
[quoted text deleted]

Thanks I created this method and it works :
2 weeks ago

Piet Souris wrote:Oke. Then drop the line with continue and do this:

The idea is that if the guess element == -1, then we have processed it before (it had an exact match and so we must not gonna count it again)
Do you know about the break statement?
The rason for that is, say:
if guess[] = [3, 1, 2] and solution[] = [1, 5, 1] and if we check the 1 from guess[], then we find immediately a matching 1 at location 0. Now, if we do not break the loop here, we would also find a match at location 2, so that we find 2 matches instead of just 1.


Thank you, I update my program but I'm just little confused on the logic for the exact matches and color count.
2 weeks ago
Thank you for your advice. We didn't yet learn about the continue statement in java.
3 weeks ago