IT Fundmentals of Programming w/ Algoriths & Logic

How would I write an object-oriented pseudocode for a system that allows a user to enter their name into a text box? When they press the Go button a message will be displayed in a label that says “Hello” and their name.

Answers

START // Define the class Class UserInterface // Define the attributes (instance variables) string name //Define the methods // Create a method to get the name from the textbox Method getName() name = textbox.getText(); // Create a method to set the message for the label Method setMessage() label.setText("Hello " + name); // Create a method to handle the "Go" button press Method handleGoButton() getName(); setMessage(); END // Create an instance of the UserInterface class UserInterface UI // Create event handling for pressing the "Go" button Event handlerForGoButton() UI.handleGoButton(); END

Answered by williamsjoshua

We have mentors from

Contact support