Skip to content

Shraddha6/JavaSimpleTasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

#About the Assignment

This assignment consist of three simple problem statement in Java.
Description is given below:-

Question 1: First Letter Printer

You are provided with a string. Your task is to create a string with the first letter of every word in the string.

Sample Test Case Input: great learning Output: gl

Test case 1 Input: When nothing goes right, go left. Output: Wngrgl

Test case 2 Input: change the world by being yourself. Output: ctwbby

Test case 3 Input: dream without fear. Love without Limits. Output: dwfLwL

Question 2: Find the Missing Number

You are provided with an array of the size n-1. It contains distinct integers in the range of 1 to n. Your task is to find the missing number.

Input format: Line 1 will take the value of n. Line 2 will take the array's contents where numbers will be in the 1-n range.

Sample Test case: 5 1 2 3 4 Output: 5

Question 3: Pattern Printer

Your task is to print the following pattern for a given n value. For n=7, pattern is:
7 7 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 4 4 4 4 4 4 4 3 3 3 3 3 3 3 2 2 2 2 2 2 2 1 1 1 1 1 1 1
7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 5 4 4 4 4 4 4 3 3 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1
7 7 7 7 7 6 6 6 6 6 5 5 5 5 5 4 4 4 4 4 3 3 3 3 3 2 2 2 2 2 1 1 1 1 1
7 7 7 7 6 6 6 6 5 5 5 5 4 4 4 4 3 3 3 3 2 2 2 2 1 1 1 1
7 7 7 6 6 6 5 5 5 4 4 4 3 3 3 2 2 2 1 1 1
7 7 6 6 5 5 4 4 3 3 2 2 1 1
7 6 5 4 3 2 1

For n=3 pattern is:
3 3 3 2 2 2 1 1 1
3 3 2 2 1 1
3 2 1

Initial SetUp Steps

Download the code import the project in Eclipse or IntelliJ IDE and run the corosponding problem statement .java file

Setup JAVA 17

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages