In: Computer Science
can you please look at the following code and fix it for me so that it does not have any syntax errors. also can you tell me what was fixed
/**
* Driver program to demonstrate calling methods of Client
class.
*
* @author Doyt Perry/Tina Comston
* @version Fall 2019
*/
public class ClientDemo
{
public static void main()
{
/**
* main method - makes this an executable program.
*/
// create a client with placeholder values
System.out.println("Client with default information");
// Create a client object using first constructor
Client client1 = new Client();
// Display information about the client
System.out.println(client1.toString());
System.out.println();
System.out.println("Create a client by providing
information");
// client last name - Jameson
// client first name - Rebecca
// client age - 32
// client height - 65
// client weight - 130
Client client2 = new Client("Jameson", "Rebecca",
32, 65, 130);
// Display information about the client
System.out.println(client2.toString());
// Display the first name
System.out.println("original first name = " +
client2.getfirstname());
// set the first name to the value Rachel
client2.setFirstName("Rachel");
// Retrieve and dislplay the client first name
System.out.println("new first name = " +
client2.getFirstName());
// Display information about the client
System.out.println(client2.toString());
// set their weight to 180
client2.setWeight(180);
// Display information about the client
System.out.println(client2.toString());
}
}
class Client { private String firstName; private String lastName; private int age; private int height; private int weight; public Client() { } public Client(String firstName, String lastName, int age, int height, int weight) { this.firstName = firstName; this.lastName = lastName; this.age = age; this.height = height; this.weight = weight; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } public int getWeight() { return weight; } public void setWeight(int weight) { this.weight = weight; } @Override public String toString() { return "firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", age=" + age + ", height=" + height + ", weight=" + weight; } } /** * Driver program to demonstrate calling methods of Client class. * * @author Doyt Perry/Tina Comston * @version Fall 2019 */ public class ClientDemo { /** * main method - makes this an executable program. */ public static void main(String[] args) { // create a client with placeholder values System.out.println("Client with default information"); // Create a client object using first constructor Client client1 = new Client(); // Display information about the client System.out.println(client1.toString()); System.out.println(); System.out.println("Create a client by providing information"); // client last name - Jameson // client first name - Rebecca // client age - 32 // client height - 65 // client weight - 130 Client client2 = new Client("Jameson", "Rebecca", 32, 65, 130); // Display information about the client System.out.println(client2.toString()); // Display the first name System.out.println("original first name = " + client2.getFirstName()); // set the first name to the value Rachel client2.setFirstName("Rachel"); // Retrieve and display the client first name System.out.println("new first name = " + client2.getFirstName()); // Display information about the client System.out.println(client2.toString()); // set their weight to 180 client2.setWeight(180); // Display information about the client System.out.println(client2.toString()); } }