1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Delicious77 [7]
3 years ago
9

As a twist on the Hello World exercise, you are going to be the end user of the Hello class. This class is designed to greet the

user in a variety of world languages. For this task, complete the following:
Use the Scanner class to ask the user for their name.
Create a Hello object by passing the name to the constructor.
Call at least 3 methods from the Hello class to print the greeting in 3 different languages.
Remember to write your code in the HelloTester class, but make sure you take a look at the Hello class so that you know the names of the methods you need to use.

Computers and Technology
1 answer:
Flura [38]3 years ago
4 0

Answer:

Here is the Hello class:

public class Hello { //class name

     private String name; //to store the name

     

      public Hello (String names) //parameterized constructor

      { name = names;  }  

     

      public void English() { //method to greet user in english

           System.out.print("Hello "); //displays Hello on output screen

           System.out.print(name); //displays user name

           System.out.println("!");  }  //displays exclamation mark symbol

           

           public void Spanish(){ //method to greet user in spanish

               System.out.print("Hola "); //displays Hello on output screen

               System.out.print(name); //displays user name

               System.out.println("!"); } //displays exclamation mark symbol

           

         public void French() { //method to greet user in french

              System.out.print("Bonjour "); //displays Hello on output screen

              System.out.print(name);  //displays user name

              System.out.println("!");  } } //displays exclamation mark symbol

           

Explanation:

Here is the HelloTester class:

import java.util.Scanner; //to accept input from user

public class HelloTester { //class name

 public static void main (String[]args)  { //start of main method

String name; //to store the name of user

Scanner input = new Scanner(System.in);  //creates Scanner class object

System.out.println("Enter name?" );  //prompts user to enter name

 name = input.nextLine(); //scans and reads the name from user

 Hello hello = new Hello(name); //creates Hello class object and calls constructor by passing name

hello.English(); //calls English method using object hello to greet in english

hello.Spanish(); //calls Spanish method using object hello to greet in spanish

hello.French(); } }  //calls French method using object hello to greet in french

The output of the program is:

Enter name?                                                                                                                    user                                                                                                                           Hello user!                                                                                                                    Hola user!                                                                                                                    Bonjour user!  

The screenshot of the program along with its output is attached.

You might be interested in
Please help me please and thank you!
MaRussiya [10]

Answer:

1. a digital designer involves movement like animations, movies, etc. A graphic designer is static for an example logos pictures etc.

2. a ux is the interaction between humans and products

3.  a ui is the design of software and machines, for an example computers, electronic devices, etc.

4.  textures, color, value, and space

5. the basics are contrast, balance, emphasis, white space, hierarchy, movement, proportion, repetition, pattern, variety, unity, and rhythm

6. the basic fundamentals are images, color theory, lay-out, shapes, and typograph  

I hope this helped you and have a great rest of your day

7 0
3 years ago
Which tabs contains options for adding shapes to a chart ? Check all that apply.
jekas [21]

is there an answer selection?

6 0
3 years ago
Which of the following is not an algorithm?
Kipish [7]

Answer:

The correct answer is: "D. shapoo instructions (lather, rinse, repeat)".

Explanation:

Among the options given, letter D is the only one which does not apply and  may not function as an algorithm. An algorithm is a set of rules and/or instructions which aims at solving a problem and/or task, therefore, "shapoo instructions" do not classify as an algorithm because they are only written informations to explain how to use a product (lather, rinse, repeat), rather than setting a procedure for solving a problem in terms of technology tools. All the other options are examples of algorithms because they already exist as such and also function as technology tools.

(ps: mark as brainliest, please?!)

7 0
3 years ago
A(n) _____ access file is also known as a direct access file.
zloy xaker [14]
The answer to the question asked  above is <span>remote direct memory .

</span>A remote direct memory  access file is also known as a direct access file.

Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.

5 0
3 years ago
Question 3<br> Which industrial revolution can the invention of the flashlight be associated with?
Ket [755]

Answer:

The invention of flashlight is associated in the late period of industrial revolution.

Explanation:

  • During the industrial revolution, Europe and United States flipped the use or technology in the manufacturing processes of industries.
  • At the time of industrial revolution many chief inventions like, steam engine, dynamites etc. were made that the traditional history and reformed the technology.
  • Thomas Edison in 1879, invented the battery and flashlight at the late period of industrial revolution which was also a major invention
7 0
4 years ago
Other questions:
  • Differentiate between Software as a service, platform as a service and infrastructure as a service.
    14·1 answer
  • Courteous behavior on the road will
    10·2 answers
  • If you are logged on to Windows Live Messenger, why would you be unable to engage
    6·1 answer
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • when files on storage are scattered throughout different disks or different parts of a disk, what is it called
    10·1 answer
  • In a PC, which of the following components stores the BIOS
    6·1 answer
  • 2.3 Code Practice: Question 1
    5·1 answer
  • The 0-1 knapsack problem is the following. A thief robbing a store finds n items. The ith item is worth vi dollars and weighs wi
    14·1 answer
  • What is a trojan horse
    8·2 answers
  • Jettison folk 2007, Magnum opus, be moving, offers poisoned commentary on the film industry.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!