Question
So I am having trouble with this computer programming problem. The question is Create a class named FormLetterWriter that includes two overloaded methods named displaySalutation().
So I am having trouble with this computer programming problem. The question is Create a class named FormLetterWriter that includes two overloaded methods named displaySalutation(). The first method takes one String parameter that represents a customer's last name, and it displays the salutation "Dear Mr. or Ms." followed by the last name. The second method accepts two String parameters that represent a first and last name, and it displays the greeting "Dear" followed by the first name, a space, and the last name. After each salutation, display the rest of a short business letter : "Thank you for your recent order." Write a main() method that tests each overloaded method. Save the file as FormLetterWriter.java. Below is my answer. However, I am receiving multiple errors such as FormLetterWriter.java:13: error: '(' expected private static void display Salutation(String firstName, String lastName) ^ FormLetterWriter.java:17: error: '(' expected private static void display Salutation(String lastName); //Program Exercise #1 public class FormLetterWriter { public static void main(String[] args) { String lastName = "Rucker"; displaySalutation(lastName); System.out.println("Thank you for your recent order."); String firstName = "Jennifer"; displaySalutation(firstName,lastName); System.out.println("Thank you for your recent order."); } private static void display Salutation(String firstName, String lastName) { System.out.println("Dear " + firstName +" " +lastName); } private static void display Salutation(String lastName); { System.out.println("Dear Mr. or Ms."+lastName); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started