Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PLEASE Design a class Message that models an e-mail message. A message has a recipient, a sender, and a message text as data members.

JAVA PLEASE image text in transcribed
Design a class Message that models an e-mail message. A message has a recipient, a sender, and a message text as data members. The class support the following methods: a. A constructor that takes the sender and recipient b. A method set Message that allows to enter a message from the keyboard. c. A method toString that displays the Sender, Recipient, and the Message. A driver program and a sample run are provided below. import java.util."; public class Q 13 public static vold main(String] args) Scanner Input= new Scanner(System.in); String sender,recipient; System.out.println("Enter sender's name": sender input.nextLine(); System.out.println("Enter recipient's name": recipient = input.nextLine(): Message mi-new Message(sender recipient); m1.setMessagell: System.out.println(ml): Sample run: public static class Message Enter sender's name: Professor Assadipour Enter recipient's name: CS 102 Students Enter Message: Your 2nd hwk is due next week. public Message(Strings, String Sender: Professor Assadipour Reciplent: CS 102 Students Message: Your 2nd hwk is due next week. public ........... Set Message() public ........toString

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions