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 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
What is the local portion of the e-mail address below? [email protected] a.) @ b.) biz c.) gumchewer d.) twrigley
Answers: 1
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
Mathematics, 12.05.2021 01:20
question
Mathematics, 12.05.2021 01:20
question
Mathematics, 12.05.2021 01:20
question
Mathematics, 12.05.2021 01:20
Questions on the website: 13722363