I need help converting the following two classes into one sql table
package Practice.model;
import java.util.ArrayList;
import java.util.List;
import Practice.model.Comment;
public class Students {
private Integer id;
private String name;
private String specialties;
private String presentation;
List<Comment> comment;
public Students() {}
public Students(Integer id,String name, String
specialties, String presentation)
{
this.id= id;
this.name = name;
this.specialties =
specialties;
this.presentation =
presentation;
this.comment = new
ArrayList<Commment>();
}
public Students(Integer id,String name, String
specialties, String presentation, List<Comment>
comment)
{
this.id= id;
this.name = name;
this.specialties =
specialties;
this.presentation =
presentation;
this.comment = comment;
}
public String getAveragecomment()
{
if(this.comment.isEmpty())
{
return
"N/A";
}
double total = 0;
for(Feedback comment:
this.comment)
{
total +=
comment.getRating();
}
return Double.toString(total /
this.comment.size());
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSpecialties() {
return specialties;
}
public void setSpecialties(String specialties)
{
this.specialties =
specialties;
}
public String getPresentation() {
return presentation;
}
public void setPresentation(String presentation)
{
this.presentation =
presentation;
}
public List<Comment> getComment() {
return comment;
}
public void setComment(List<Comment> comment)
{
this.comment = comment;
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
package Practice.model;
import java.util.Date;
public class Comment {
int rating;
String name;
String message;
Date date;//
public Comment() {}
public Comment ( int rating, String name, String
message)
{
this.rating = rating;
this.name = name;
this.message = message;
this.date = new Date();//
}
public int getRating() {
return rating;
}
public void setRating(int rating) {
this.rating = rating;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Date getDate()//
{
return date;
}
public void setDate( Date date )//
{
this.date = date;
}
}
I need help converting the following two classes into one sql table package Practice.model; impor...
I need help displaying two zeroes in hours:minutes:seconds. In Java. I need some help for the time to display correctly. I want it to display double zeroes. 06:00:00 and 12:00:00. public class Clock { String name; static int uid=100; int id; int hr; int min; int sec; public Clock() { this.name="Default"; this.id=uid; this.hr=00; this.min=00; this.sec=00; uid++; } public Clock(String name, int hr, int min, int sec) { if (hr<=24 && min <=60 && sec <=60) { this.hr = hr; this.min...
Java Do 72a, 72b, 72c, 72d. Code & output required. public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...
CS HELP Use sets to solve this problem package log; import java.io.IOException; import java.io.Reader; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class LogParser { /** * Returns a list of SuspectEntries corresponding to the CSV data supplied by the given Reader. * * The data contains one or more lines of the format: * * Marc,413-545-3061,1234567890 * * representing a name, phone number, and passport number. * * @param r an open Reader object * @return a list of SuspectEntries...
Below, you can find the description of your labwork for today. You can also find the expected output of this code in the Application Walkthrough section. You are going to improve your existing Money & Stock Trading Platform on previous week’s labwork by incorporating Collections. In previous labworks, you have used arrays for holding Customer and Item objects. For this labwork you need to use ArrayList for holding these objects. So, rather than defining Customer[] array, you need to define...
Implement the following in java. 1. An insertAtBeginning(Node newNode) function, that inserts a node at the beginning(root) of the linked list. 2. A removeFromBeginning() function, that removes the node from the beginning of the linked list and assigns the next element as the new beginning(root). 3. A traverse function, that iterates the list and prints the elements in the linked list. For the insertAtBeginning(Node newNode) function: 1. Check if the root is null. If it is, just assign the new...
write comments // on this program please //Inside package bloodDonation //BloodDonor.java class package bloodDonation; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Scanner; public class BloodDonor { long idNumber, cardNumber; String name, bloodGroup, homePhone, mobilePhone, address, lastDateOfDonation; SimpleDateFormat myFormat = new SimpleDateFormat("dd MM yyyy"); public BloodDonor(){ this.idNumber = 0; this.cardNumber = 0; this.name = ""; this.bloodGroup = ""; this.homePhone = ""; this.mobilePhone = ""; this.address = ""; ...
How to create a constructor that uses parameters from different classes? I have to create a constructor for the PrefferedCustomer class that takes parameters(name, address,phone number, customer id, mailing list status, purchase amount) but these parameters are in superclasses Person and Customer. I have to create an object like the example below....... PreferredCustomer preferredcustomer1 = new PreferredCustomer("John Adams", "Los Angeles, CA", "3235331234", 933, true, 400); System.out.println(preferredcustomer1.toString() + "\n"); public class Person { private String name; private String address; private long...
Can anyone identify which OO Design Patterns are being used in the following code?: package mis; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; class helpDeskGuidline{ private void setGuideLine(){ } public void rateService(){ } } public class HelpDeskService extends helpDeskGuidline{ //HelpDeskService class extends helpDeskGuidline this //called inheritance private static int ticketId=1; Ticket ticket; // HelpDeskService class using ticket class object. this is has-A relationship (aggregation) ArrayList<Ticket> allTicket=new ArrayList<>(); HashMap<Ticket,Person> ticketAllocation=new HashMap<>(); HashMap<Person,Integer> assignee=new HashMap<>(); HelpDeskService(){ Person...
Java Do 68a, 68b, 68c, 68d. Show code & output. public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...
JAVA: How do I output all the data included for each employee? I can only get it to output the name, monthly salary and annual salary, but only from the Employee.java file, not Salesman.java or Executive.java. Employee.java package project1; public class Employee { private String name; private int monthlySalary; public Employee(String name, int monthlySalary) { this.name = name; this.monthlySalary = monthlySalary; } public int getAnnualSalary() { int totalPay = 0; totalPay = 12 * monthlySalary; return totalPay; } public String...