Skip to main content

Programming using Java Hands On - Control Structures | Print Username

 

Print Username

Jeffy, who is going to complete the higher education in this year needs to create a simple application which accept the name of a person and welcome them with a message along with their name. She wants to read the data using the class "Scanner". Implement this scenario using Java.

Sample Input 1: 

Enter the name:

Johson

Sample Output 1:

Welcome Johnson.


Sample Input 2: 

Enter the name:

Stain Polson

Sample Output 2:

Welcome Stain Polson.



 

Result Description

Summary of tests
*Note: All the test cases might not have same weightage
+------------------------------+
|  2 tests run/ 2 tests passed |
+------------------------------+
 

Comments

Must Read:

Min Cost In Maze Traversal

1. You are given a number n, representing the number of rows. 2. You are given a number m, representing the number of columns. 3. You are given n*m numbers, representing elements of 2d array a, which represents a maze. 4. You are standing in top-left cell and are required to move to bottom-right cell. 5. You are allowed to move 1 cell right (h move) or 1 cell down (v move) in 1 motion. 6. Each cell has a value that will have to be paid to enter that cell (even for the top-left and bottom-       right cell). 7. You are required to traverse through the matrix and print the cost of path which is least costly. Input Format A number n A number m e11 e12.. e21 e22.. .. n * m number of elements Output Format The cost of least costly path. Constraints 1 <= n <= 10^2 1 <= m <= 10^2 0 <= e1, e2, .. n * m elements <= 1000 Sample Input 6 6 0 1 4 2 8 2 4 3 6 5 0 4 1 2 4 1 4 6 2 0 7 3 2 2 3 1 5 9 2 4 2 7 0 8 5 1 Sample Output 23 Solution: import java.io.*; import...

Programming using Java Hands On - Control Structures | Bill Generation

Bill Generation Tom went to a movie with his friends in a multiplex theatre and during break time he bought pizzas, puffs and cool drinks.  Consider   the following prices :  Rs.100/pizza Rs.20/puffs Rs.10/cooldrink Generate a bill for What Tom has bought. Sample Input 1: Enter the no of pizzas bought:10 Enter the no of puffs bought:12 Enter the no of cool drinks bought:5 Sample Output 1: Bill Details No of pizzas:10 No of puffs:12 No of cooldrinks:5 Total price=1290 ENJOY THE SHOW!!! Result Description Summary of tests *Note: All the test cases might not have same weightage +------------------------------+ | 6 tests run/ 6 tests passed | +------------------------------+

Programming using Java Running case study - Requirement 1 / 6 | State Board of Cricket Council –V1.0 *

  State Board of Cricket Council –V1.0 * State Board of Cricket Council   State Board of Cricket Council (SBCC) is one of the leading cricket selection academies in the state . They are in need of an automated system that should manipulate the player details provided and also find the players who have secured star rating between a specific range from the database. You being their software consultant have been approached to develop a pilot java application which can be used by the  admin for the above mentioned requirement . UserInterface.java package  com.sbcc.main; import  com.sbcc.model.*; import  java.util.*; import  java.lang.*; import  com.sbcc.skeletonvalidator.SkeletonValidator; public   class   UserInterface  {      public   static   Player   pl ;      public   static   void   main ( String []  args ) {        ...

Zig Zag Pattern

  /* @ToDo     Zig Zag Pattern         *               *                *       *       *       *        *               *               *        */ #include   <iostream> using   namespace   std ; int   main (){       #ifndef  ONLINE_JUDGE          freopen ( "../asset/input.txt" , "r" , stdin );          freopen (...

Zero One Knapsack | Recursion

 1. You are given a number n, representing the count of items. 2. You are given n numbers, representing the values of n items. 3. You are given n numbers, representing the weights of n items. 3. You are given a number "cap", which is the capacity of a bag you've. 4. You are required to calculate and print the maximum value that can be created in the bag without       overflowing it's capacity. Note: Each item can be taken 0 or 1 number of times. You are not allowed to put the same item again and again. Input Format A number n v1 v2 .. n number of elements w1 w2 .. n number of elements A number cap Output Format A number representing the maximum value that can be created in the bag without overflowing it's capacity Constraints 1 <= n <= 20 0 <= v1, v2, .. n elements <= 50 0 < w1, w2, .. n elements <= 10 0 < cap <= 10 Sample Input 5 15 14 10 45 30 2 5 1 3 4 7 Sample Output 75 Solution: import java.io.*; import java.util.*; public class Main...

Software Engineering Concepts Configuration Management And Version Control Post-Quiz

 Software Engineering Concepts       Configuration Management And Version Control            Post-Quiz

Web Technology HTML 5 HTML 2 | Quiz 1

 Web Technology       HTML 5            HTML 2               Quiz 1  

Accenture TFA Quiz | Part 1

  Question  1 Correct Marked out of 1 Flag question Question text The employee table contains EmployeeNumber, EmployeeName, Salary and DeptCode Columns. Which is the CORRECT SQL query to display DeptCode and average salary of each department? Choose most appropriate option. Select one: a.  SELECT DeptCode,avg(salary) FROM Employee GROUP BY DeptCode;   b.  SELECT DeptCode,avg(salary) FROM Employee GROUP BY EmployeeNumber; c.  SELECT DeptCode,avg(salary) FROM Employee; d.  SELECT DeptCode,avg(salary) FROM Employee GROUP BY Salary; Feedback The correct answer is: SELECT DeptCode,avg(salary) FROM Employee GROUP BY DeptCode; Question  2 Correct Marked out of 1 Flag question Question text Which is the CORRECT SQL Query to display names of employees which has only 3 letters that starts with 'A' and ends with 'e'? Choose most appropriate option. Select one: a.  SELECT EmployeeName FROM Employee WHERE EmployeeName LIKE 'A_e';   b.  SELECT Em...

Programming using Java Hands On - Control Structures | Print Customer Details

Print Customer Details Help Mr.Ben who is a programmer, in developing a registration form on console. Customers will not just input data, but also view the details once he/she finishes the registration.  Sample Input 1: Enter your name:Jany Enter age:25 Enter gender:Female Hailing from:Mexico Sample Output 1: Welcome, Jany Age:25 Gender:Female City:Mexico Result Description Summary of tests *Note: All the test cases might not have same weightage +------------------------------+ | 5 tests run/ 5 tests passed | +------------------------------+

Subscribe to Get's Answer by Email