Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Word Rotation


Given a sentence and an integer N, write a program to rotate letters of the sentence among the words without changing the length of those words and positions of the spaces.


Input

The first line of input will be a sentence.

The second line of input will be an integer N.


Output

The output should be a single line containing the sentence by rotating the letters among the words without changing the length of the words and positions of the spaces.


Explanation

For example, if the given sentence and N are


Welcome to your first problem

5

Rotate the sentence 5 letters towards right side without changing the length of the words and position of spaces in the original sentence.


So the output should be

oblemWe lc omet oyour firstpr


Sample Input 1

Welcome to your first problem

5

Sample Output 1

oblemWe lc omet oyour firstpr


Sample Input 2

All the best

2

Sample Output 2

stA llt hebe


Purchase List

At a shop, a shopkeeper is making a note of all the purchases at the end of the day.He has a list full of the purchases that happened at the shop.He wants to know which item got sold only once and which item got sold more than once.Print their prices as asked.


Note:In case of ties, choose the price of the item that was sold earlier in the day.


Input

The input is a single line containing space-separated integers representing the prices of the purchases.


Output

The first line of the output contains an integer that represents the price of an item that is sold only once.

The second line of the output contains an integer that represents the price of an item that is sold more than once.


If there is no filling the given criteria, print None.



Sample Input1

5 5 4 7 4 1 11

Sample Output1

7

5


Sample Input2

1 2 3 4 5 6 7 8 9

Sample Output2

1

None


Math Quiz


Write a python program to print the following,


Sample Input 1

1 3 4 5 6

5

3 5

Sample Output1

12


Create a class Book with title, author, and cost as data members. Include a constructor and a member function show Book () to set and print the member values respectively. Write main a method to demonstrate the Book class.

details for students and staff using inheritance. Student details: name, address, percentage marks. Staff details: name, address, salary.

String Lookup

Ram challenges Anil to a game, He decides to give a target word W to Anil.The rules of the game are very simple.Ram gives Anil N sentences one by one and asks Anil to print the first sentence which contains the given word W.If the sentence numbering starts from 1, can you identify the first sentence number containing the word W?


Note: Consider lower and upper case letters as different.


Input

The first line of input is the word W.

The second line of input is a positive integer N.

The next N lines of input contain a string in each line.


Output

The output should be a single line containing an integer.

If the given word is not in any line of input strings, print -1.


Develop a C++ program implementing hierarchical inheritance upon a base class "Employee", and derived classes "Full-time" containing basic salary and allowances for calculating the salary of the employee and "Part-time" containing rate_per_day and no. of

A local waterfront tour guide recently purchased a computer and needs a reservation system created. The sailboat has enough seating for 10 people. There will be 5 premium seats and 5 regular seats.


Your program should contain an array of Strings to hold up to ten people. Use seats (1-5) for the premium seats and seats (6 - 10) for the regular seats. Ask the user for a full name and whether they want a premium seat or not. The program should then assign them a seat (this can be done randomly, manually assigned by the user, or any other way as long as they are assigned to the correct section). It should then display a ticket / boarding pass indicating the person's name and their seat number.


Your application should never assign a seat to a person who already has a seat. It should also tell the user once all of the tickets have been assigned and the boat is full.


Display all of the tickets to the user once you have assigned the seats.


Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer. Your program should output only the nearest rounded value on a newline. 

Enter a decimal value: 2.2
2

Write a program that produces the following output:

CCCCCCC
C         +      +
C       +++++  +++++
C         +      +
CCCCCCC





LATEST TUTORIALS
APPROVED BY CLIENTS