Andreas Loon

Greenhorn
+ Follow
since Oct 26, 2022
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Andreas Loon

whatever I looked up online, I keep getting the following error when trying to run a jar file

javafx runtime components are missing and are required to run this application

any hints ?
2 years ago
This works.  what would be the easiest way to set the colour of these 4 series ?  Groen means green for example, but BarChart sets the colour of the 4 series itself.
I also have to make a splashscreen upon starting the app, again I cannot use fxml so how would this fit in the MVP design pattern ?

Model:



View:



Presenter:


Main:



2 years ago
Hi there, for an assigment we are supposed to use the model view presenter design patern.
The goal is to show how many students have failed (red sign), just passed (yellow), orange and red for failing.  The data is read in by a a readCsv structure and stored in an Arraylist<PeriodResults>.  So an Arraylist of instances of class PeriodResult.  In the class PeriodResult the logic is put to determine in what colour a student belongs depending on a certain amount of grades he/she has on a couple of course.  For example failing more then 2 courses is failed and results in a colour red indication and a certain email the student will receive.  So far so good.

Now in my GUI in a third tab I  have to put a BarChart.  We must use MVP design patern, this means we have a model containing the business logic, a view which has to render the BarChart in the tab and a presenter which passes on information between model and view.
As model I would make a Chart class



a constructor



would this be the right way for the constructor ?

The method for counting how many students are in green, yellow, orange or red (groen, geel, oranje and rood in Dutch ;-)  )



The view class



The part I am struggling with is the presenter binding the 2 together



There is no error in the code but on compiling I keep getting error pointing out required data for the graph is NULL so something is not filling the required series for the graph I guess ?


they are fictional, but I understand.  
Intent was to show future readers what the endgoal was of my questions, what is often not easy to figure out.
That seems to work, I only get an error : cannot be accessed from outside package for this import

import static java.util.stream.Nodes.collect;
One more question, if implement it as stated with a separate record class with constructor



and then the implementation with streams



studentlist being the result of a readCsv() method resulting in a Map<Student,Arraylist<Result>>

I get an error on the /toList() method.  'No candidates found for methode call ...'  ' cannot resolve method...'
Ok thanks, but record is a class, so would the create method then be simply the constructor ? Or does it not work like this when using lambda's ?

I have a csv file containing grades of students, which I read into a Map<Student,ArrayList<Result>> studentList with a readCsv() method using bufferedReader.
This allows me to assess for a certain student how many courses he/she failed, passed etc.  and show in a tableview the results.
To complete the UI, I would like to first make a visual representation of the csv file in a tableview.  So first tab shows what's in the file, second tab shows a table with on each line the evaluation for a certain student.

Since I allready have the Map<Student,ArrayList<Result>> studentList from the readCsv() methode, how would I convert or flaten this map to a list of records.
So 1 record is 1 line in the .csv file.  A record is a separate class where the attributes are simply the column headers (e.g. name, surname, email, course, grade, etc.)

How to expand or flatten the keys and values of the map to a list of records ?
So far this works



To deal with the results, I created the following Result class



The getter to retrieve grades



To get overall results a separate PeriodResult class is made with an enum to indicate the colour code depending on the amount of failed or passed courses





The main method



As a final result I need to make a GUI to load and represent the data and send emails to the students.
My idea of the gui was the attached setup.  Fxml is not allowed, the idea was to implement it as a tableview.

How would I load the csv read data into a tableview ?





2 years ago
Hi and thanks for the swift reply.
The csv is in the following format :

email surname name course grade type Weight Period
[email protected] Jef Daniels Operating Systems 16.33 PartialEvaluation 1 25% november
[email protected] Jef Daniels Hardware xx PartialEvaluation 1 50% november
[email protected] Jef Daniels Databank 9.0 PartialEvaluation 1 50% november
[email protected] Kenny Rogers Hardware 8.66 PartialEvaluation 1 50% november
[email protected] Kenny Rogers Operating Systems 12.33 PartialEvaluation 1 25% november
[email protected] Kenny Rogers OO Concepts 7.00 PartialEvaluation 1 30% november
[email protected] Greta Thunberg OO Concepts 11.00 PartialEvaluation 1 30% november
[email protected] Greta Thunberg Hardware 15.33 PartialEvaluation 1 50% november
[email protected] Greta Thunberg Operating Systems 17.33 PartialEvaluation 1 25% november

The goal not to just show information, an assessment needs to be made if a student for example fails at more then 4 courses, he receives an email with a certain message, same goes for passing 3 or more courses etc. all with different types of feedback emails.
So in my view for a student object needs to have a set of results in order to evaluate him.   I think I just best look into openCsv or Apache csv.
2 years ago
Hello,
I have an assignment to read student grades from a csv file.  Each represents a result a certain student obtained for a certain course.  
A student can appear on several lines, since he/she has taken a number of courses.  

The Student class constructor looks like this



So a student has a list of results.

For the readCsv () function my guess would be to make a list of maps.  The student being the key and the result arraylist as the value(s).



I keep getting on an error on the way the studentlist is composed.
Would it be better to just store in a list of strings and then use separate logic to get the results student by student ?
How would I be able to recognize identical students ?  Surname and name are in different columns.

Thanks in advance.
2 years ago