007-003-010

Pet Greeting Program

Easy

Problem Description

Pet Greeting Program

In this problem, you will create a program that defines a Cat class, instantiates it, and calls the greet() method to display Meow! to standard output.

Learning Objective: Understand the basics of class instantiation and method invocation

Overview

Create a Cat class and a program where the cat greets. Learn how to create objects from classes and call methods.

Specifications

  1. Define a greet() method in the Cat class
  2. The greet() method outputs Meow!
  3. In the Main class, create a Cat instance and call greet()

Output Format

Meow!

Hints

  • Create an instance with new Cat()
  • Call the method with .greet()

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up