Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

How do books become world of wonder?

Answered: 1 week ago