Carly’s Catering provides meals for parties and special events. Write a program
that displays Carly’s motto, which is “Carly’s makes the food that makes it a
party.” Save the file as CarlysMotto.java. Create a second program that displays the motto surrounded by a border composed of asterisks. Save the file as
CarlysMotto2.java.
public class CarlysMotto {
public static void main(String[] args) {
System.out.println("Carly’s makes the food that makes it a party.");
//second part of program
System.out.println("************************************************");
System.out.println("*Carly’s makes the food that makes it a party.*");
System.out.println("************************************************");
}
}
Explanation
The goal of this program is to write two Java programs that display Carly’s Catering motto. The first program, named “CarlysMotto.java,” will simply display the motto “Carly’s makes the food that makes it a party.” on the console. The second program, named “CarlysMotto2.java,” will display the motto surrounded by a border made up of asterisks (*).
The first program will create a class named “CarlysMotto” and use the main method to print the motto. The main method will use the System.out.println method to display the motto on the console.
The second program will follow the same process, creating a class named “CarlysMotto2” and using the main method to display the motto. However, in this program, the motto will be surrounded by asterisks to create a border. The main method will use multiple calls to the System.out.println method to display the asterisks and the motto on the console.
Both programs will need to be saved in separate .java files with the appropriate names, CarlysMotto.java and CarlysMotto2.java, respectively.
Leave a Reply