subject

For this exercise, you are going to write your code in the FormFill class instead of the main method. The code is the same as if you were writing in the main method, but now you will be helping to write the class. It has a few instance variables that stores personal information that you often need to fill in various forms, such as online shopping forms. Read the method comments for more information.
As you implement these methods, notice that you have to store the result of concatenating multiple Strings or Strings and other primitive types. Concatenation produces a new String object and does not change any of the Strings being concatenated.
Pay close attention to where spaces should go in theString, too.
FormFillTester has already been filled out with some test code. Feel free to change the parameters to print your own information. If you don’t live in an apartment, just pass an empty String for the apartment number in setAddress.
Don’t put your real credit card information in your program!
When you run the program as written, it should output
Dog, Karel
123 Cherry Lane
Apt 4B
Card Number: 123456789
Expires: 10/2025
public class FormFill
{
private String fName;
private String lName;
private int streetNumber;
private String streetName;
private String aptNumber;
// Constructor that sets the first and last name
// streetNumber defaults to 0
// the others default to an empty String
public FormFill(String firstName, String lastName)
{
}
// Sets streetNumber, streetName, and aptNumber to the given
// values
public void setAddress(int number, String street, String apt)
{
}
// Returns a string with the name formatted like
// a doctor would write the name on a file
//
// Return string should be formatted
// with the last name, then a comma and space, then the first name.
// For example: LastName, FirstName
public String fullName()
{
}
// Returns the formatted address
// Formatted like this
//
// StreetNumber StreetName
// Apt AptNumber
//
// You will need to use the escape character \n
// To create a new line in the String
public String streetAddress()
{
} // Returns a string with the credit card information
// Formatted like this:
//
// Card Number: Card#
// Expires: expMonth/expYear
//
// Take information as parameters so we don't store sensitive information!
// You will need to use the escape character \n
public String creditCardInfo(int creditCardNumber, int expMonth, int expYear)
{ }
}
public class FormFillTester
{
public static void main(String[] args)
{
FormFill filler = new FormFill("Karel", "Dog");
filler. setAddress(123, "Cherry Lane", "4B");
System. out. println(filler. fullName());
System. out. println(filler. streetAddress());
System. out. println(filler. creditCardInfo(123456789, 10, 2025));
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
question
Computers and Technology, 24.06.2019 15:50
Andy would like to create a bulleted list. how should he do this? andy should click on the bullet icon or select the bullet option from the menu and then type the list. andy should press the shift key and the 8 key at the beginning of each line of text. andy should type the text and then click on the bullet command. andy should press return and the bullets will automatically
Answers: 2
You know the right answer?
For this exercise, you are going to write your code in the FormFill class instead of the main method...
Questions
question
Biology, 27.10.2020 20:40
question
History, 27.10.2020 20:40
question
Mathematics, 27.10.2020 20:40
question
Mathematics, 27.10.2020 20:40
question
Geography, 27.10.2020 20:40
question
Mathematics, 27.10.2020 20:40
Questions on the website: 13722363