![Quick Access 熅Package Explorer 23 曰ちい▽ーロ D Volunteer,java D Volunteer Test.java 23 -ロ 貝Task List 2 public class VolunteerTest ▼申(default package) Volunteer java 4 public static void main(String[] args) Find THIS CODE MUST NOT BE CHANGED IN ANY WAY!1 JRE System Library [JavaSE-18] // The code below will be used to test the Volunteer class I/ created by the students for Lab 3 10 THIS CODE MUST NOT BE CHANGED IN ANY WAY!!! Connect Mylyn // Use constrictors to create an empty volunteer object /1 and an object containing data Volunteer volunteer1-new VonO: Volunteer volunteer2 new Volunteer Bill, Gates, 5); 12 13 14 15 16 17 18 19 20 Connect to your task and ALM tools or greate a local task Outline //Display the initial values in the objects System.out.printfC volunteer1 name issn, volunteer1.getName) System , out . printf(volunteer1 hours available is : %s%n%n, volunteer!.getHoursAvailat System.out.printf(volunteer2 name is : %sKn, volunteer2.getName()); System.out.printf(volunteer2 hours available is : %s%n%n, volunteer2.getHoursAvailat //Update the objects volunteer1.setFirstNameCMelinda; volunteer1.setLastName( Gates; volunteer1.setHoursAvailable(18); volunteer2.setHoursAvailable(7); R Problems @ Javadoc 见Declaration-Console× <terminated> VolunteerTest [Java Application] /Library)Java/JavaVirtualMachines(jdk1,8.0 102.jdk/Contents/Home/bin/java (Aug 17, 2017, 11:12:49 AM volunteer1 name is : nullnull volunteer1 hours available is0 volunteer2 name is: BillGates volunteer2 hours available is :5 volunteer1 name is :MelindaGates volunteer1 hours available is: 18 volunteer2 name is BillGates volunteer2 hours available is :7 Writabl Smart Insert 12: 22](http://img.homeworklib.com/questions/15458a60-bb9a-11eb-9e36-951d9f24e32b.png?x-oss-process=image/resize,w_560)
I need help in this basic java programming. I just need a program that output this according to the original picture above.
Volunteer.java
public class Volunteer {
//instance variables
private String firstName;
private String lastName;
private int hoursAvailable;
//default parameter
public Volunteer()
{
this.firstName = null;
this.lastName = null;
this.hoursAvailable = 0;
}
//constructor with parameters
public Volunteer(String firstName, String lastName, int hoursAvailable)
{
this.firstName = firstName;
this.lastName = lastName;
this.hoursAvailable = hoursAvailable;
}
//getters
//method that returns name
public String getName()
{
return this.firstName+this.lastName;
}
//method that returns hours available
public int getHoursAvailable()
{
return this.hoursAvailable;
}
//setters
//method that sets firstname
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
//method that sets lastname
public void setLastName(String lastName)
{
this.lastName = lastName;
}
//method that sets lastname
public void setHoursAvailables(int hoursAvailable)
{
this.hoursAvailable = hoursAvailable;
}
}
VolunteerTest.java
public class VolunteerTest {
public static void main(String[] args) {
// Use constructors to create an empty volunteer object
// and an object containing data
Volunteer volunteer1 = new Volunteer();
Volunteer volunteer2 = new Volunteer("Bill", "Gates", 5);
//Display the initial values in the objects
System.out.printf("volunteer1 name is : %s%n", volunteer1.getName());
System.out.printf("volunteer1 hours available is : %s%n%n", volunteer1.getHoursAvailable());
System.out.printf("volunteer2 name is : %s%n", volunteer2.getName());
System.out.printf("volunteer2 hours available is : %s%n%n", volunteer2.getHoursAvailable());
//Update the objects
volunteer1.setFirstName("Melinda");
volunteer1.setLastName("Gates");
volunteer1.setHoursAvailables(10);
volunteer2.setHoursAvailables(7);
//Display the update values in the objects
System.out.printf("volunteer1 name is : %s%n", volunteer1.getName());
System.out.printf("volunteer1 hours available is : %s%n%n", volunteer1.getHoursAvailable());
System.out.printf("volunteer2 name is : %s%n", volunteer2.getName());
System.out.printf("volunteer2 hours available is : %s%n%n", volunteer2.getHoursAvailable());
}
}
Output:

Let me know if you have any concerns with the above solution
I need help in this basic java programming. I just need a program that output this...
help fixing this code in JAVA
SIC 7 19 11 12 src eclipse-workspace - doublesalary2/src/module-info.java - Eclipse IDE HG2GP Package Explorer X B J "module-info.java X J module-info.java Outline X Assigment 1 @ 1 module doublssalary21 bill import java.util.Scanner; doublosalary2 doublasalary N 4 public class DoubleSalary I DoubleSalary > JRE System Library (JavaSE-14) M 5 public static void main(String[] args) { @ main(Stringni : void 6 Scanner sc = new Scanner(System.in); doublasalary2 System.out.print("Enter number of days: "); 8 ► JRE...
How do I correct this error in my code?
When it got to the file type I can only go "null" from a certain
point and I'm wondering how to correct this error.
Also can I get a word document on this coding strategy for this
problem? How much of this am I doing correctly?
The original problem description:
Create a program that provides a listing of all the files in a
directory. The program should be a Java application...
Really need help with this. This is for my Advanced Java Programming Class. If anyone is an expert in Java I would very much appreciate the help. I will provide the code I was told to open. Exercise 13-3 Use JPA to work with the library checkout system In this exercise, you'll convert the application from the previous exercise to use JPA instead of JDBC to access the database. Review the project Start NetBeans and open the project named ch13_ex3_library that's...
Need help with this Java. I need help with the "to do" sections.
Theres two parts to this and I added the photos with the entire
question
Lab14 Part 1:
1) change the XXX to a number in the list, and YYY to a
number
// not in the list
2.code a call to linearSearch with the item number
(XXX)
// that is in the list; store the return in the variable
result
3. change both XXX numbers to the...
Input hello, I need help completing my assignment for java,Use the following test data for input and fill in missing code, and please screenshot output. 1, John Adam, 3, 93, 91, 100, Letter 2, Raymond Woo, 3, 65, 68, 63, Letter 3, Rick Smith, 3, 50, 58, 53, Letter 4, Ray Bartlett, 3, 62, 64, 69, Letter 5, Mary Russell, 3, 93, 90, 98, Letter 6, Andy Wong, 3, 89,88,84, Letter 7, Jay Russell, 3, 71,73,78, Letter 8, Jimmie Wong,...
******Java Programming Hi guys, I really need you help. I created a code for my java course, but it keep giving me error messages. Majority of my code is fine but some keep display error on my console. I was hoping someone could pin points the problem. .There are three classes with the testCenter class being the main class. In the following is the assignment, and the bottom is my code. Please help! Assignment: Concepts: GUI User Design Graphics Deployment...
Please Implement this code using Java Eclipse.
CIS 1068 Assignment 8 Warm Up with Objects Due: Wednesday, March 25 70 points (+ up to 15 extra credit) The purpose of this assignment is to give you practice implementing your own classes. It also provides extra practice with arrays. Task Implement a class Task, which is used to represent a job that should be done. It should contain the following private fields: .name text description of what job should be done...
Java Programming
The program template represents a complete working Java program
with one or more key lines of code replaced with comments. Read the
problem description and examine the output, then study the template
code. Using the problem-solving tips as a guide, replace the /* */
comments with Java code. Compile and execute the program. Compare
your output with the sample output provided. Modify class Time2 to
include a tick method that increments the time stored in a Time2
object...
I need help writing my main method**** Computer Science 111 Introduction to Algorithms and Programming: Java Programming Project #4 – Classes and Objects (20 Points) You will create 3 new classes for this project, two will be chosen from the list below and one will be an entirely new class you invent.Here is the list: Shirt Shoe Wine Book Song Bicycle VideoGame Plant Car FootBall Boat Computer WebSite Movie Beer Pants TVShow MotorCycle Design First Create three (3) UML diagrams...
Hallo! I have a problem in my code, I need help please in java code. My task is : Write a program that can read a text from a file and do frequency analysis on the letters that occur . To store information (frequency) you must use an array. Tip! The place where you collect the frequency of eg the letter A is the equivalent of the ASCII code of "A" ie 65. The array should be 127 elements. For...