Wednesday, April 6, 2022

Input Name in Scala

 Machine Problem

Write a program that will ask the user to give first name, and last name and then the program will greet the user by displaying the first name, and last name of the user on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg


=================================================

Want to support my channel?


GCash Account


Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada






Program Listing

/* Input_Name.scala
   Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
   www.jakerpomperada.blogspot.com and www.jakerpomperada.com
   jakerpomperada@gmail.com
   November 11, 2021  8:21 PM Thursday
   Bacolod City, Negros Occidental
 */


import java.util.Scanner;

object Input_Name {

  def main(args: Array[String]) : Unit = {

    var input = new Scanner(System.in);

    print("\n\n");
    print("\tInput Name in Scala");
    print("\n\n");
    print("\tGive Your First Name : ");
    var first_name = input.nextLine();
    print("\tGive Your Last Name  : ");
    var last_name = input.nextLine();
   
    print("\n");
    print("\tHello " + first_name + " "  +  last_name + ". How are you? \n");
     print("\n");
    print("\tEND OF PROGRAM");
    print("\n\n");
  }
}

No comments:

Post a Comment