Hello I started a programming class and I was given an assig

Hello. I started a programming class and I was given an assignment that I am totally clueless on. Could you assist me please? Thank you!

Instructions Write a Java class definition to describe a car loan taken by two people. The class should be called CarLoan have the following variables: bank Name a String to store the name of the bank accountNumber an integer to store the account number signer a Person cosigner a Person It should also have the following method: getInfo returns a string that is the concatenation of the bankName and accountNumber with a space between them (e.g., \"Pathfinder 876532

Solution

Hi Buddy, These are the two classes.

//Person class defines a person. It contains attributes. 2 attribues are added by me as an example

class Person{
//These are the sample variables added by me
String name;
String designation;
}

//This class is the required class.
class CarLoan{
private String bankName;
private int accountNumber;
private Person signer, coSigner;
//This method returns the String that is the concatenation of bankName and accountNumber
public String getInfo(){
return bankName+\" \"+accountNumber;
}
}

Hello. I started a programming class and I was given an assignment that I am totally clueless on. Could you assist me please? Thank you! Instructions Write a Ja

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site