Concatenate Word Pairs
Given a sentence and an integer L, write a program to concatenate word pairs so that the concatenated word has the length L.
Input
The first line of input will be a sentence.
The second line of input will be an integer L.
Output
The output should be containing the unique concatenated word pairs each in a line in the lexicographical order.
Explanation
For example, if the given sentence and L are
Welcome to your exam
6
The words which can be paired so that they make concatenated word with length 6 are
Word1 Word2
to your
to exam
exam to
your to
So the output should be printing each concatenated word in a line in the lexicographical order
examto
toexam
toyour
yourto
Sample Input 1
Welcome to your exam
6
Sample Output 1
examto
toexam
toyour
yourto
Sample Input 2
My parents and I went to a movie
9
Sample Output 2
Myparents
moviewent
parentsMy
parentsto
toparents
wentmovieHow we can access the private and protected members of class in other class or function without using inheritance. Write Example of Weight class which has two private data members kg and gram.There is a nonmember function AddTen() which object of weight class and adds the values ten to kg and gram.
Create an application which consist of following module:a.Signup Panel which consists of user required fields (username, password, Email,Address, phone).
b.After Signup user must login with Id and password while ID must be generated automatically when you signup and generate the unique id in database.
c.Email address must be valid by using email address pattern by Regex.
d.Phone number field must be numeric we cannot enter string in phone.
e.Username must contain characters.
Create a class Calculator having two integer data members and one string member i.e. operator. Class contains only one customized constructor which takes two arguments, set the default values 1 if no argument ispassed through the constructor. Class Calculator also contains a member function Calculate () that takes an operator (string) as an argument and compute it. Only four operators are allowed i.e. +, -, *, /
Create the classes required to store data regarding different types of Courses. All course shave name, duration and course fee. Some courses are part time where you have to storethe timing for course. Some courses are onsite where you have to store the companyname and the no. of candidates for the course. For onsite course we charge 10% more on the course fee. For part-time course, we offer 10% discount.Provide constructors and the following methods.Print() GetTotalFee()
Write a program that will randomly generate 500 integer numbers in the range -249 to 250. Write those
numbers in a text file named “in.txt”. Now Sort (in ascending order) all the integer numbers in the file “in.txt”
using Bubble Sort. Save the sorted output into another text file named “out.txt”. (Try to write separate
function for SWAP and BUBBLE_SORT and call them from main function.)
Write a program that will randomly generate 1000 uppercase letters. Write those alphabets in a text file
named “in.txt”. Now Sort (in ascending order) all the alphabets in the file “in.txt” using insertion sort. Use
separate function for REPLACEMENT_SORT. Show the sorted output in your console window.