Victor has an array of size n.He loves to play with these n numbers.each time he plays with them ,he picks up any two consecutive numbers and adds them. on adding both numbers, it costs him K*(sum of both numbers).
Find the minimum cost of adding all the numbers in the array.
i/p1:size of array
i/p2:elements of array
i/p3:value of K
o/p:return the maximum cost of adding all the numbers of the array.
Ex1:
i/p1:3
i/p2:{1,2,3}
i/p3:2
o/p:18
1. Create a C++ program to accept two integers and check if it is greater than or equal to 20.
2. Build a C++ program to read the temperature in centigrade and display a suitable message according to the temperature state below: (nested-if else/switch case)
Temp < 0 then Freezing weather
Temp 0-10 then Very Cold weather
Temp 10-20 then Cold weather
Temp 20-30 then Normal in Temp
Temp 30-40 then it is Hot
Temp >=40 then it is Very Hot
Example input: 42
Expected Output:
It is very hot.
ID Card: In Rahul's college, every student is uniquely identified by a string(unique id) which is printed on the ID card of the student.This unique id is comprised if letters and digits separated by hyphens into groups of different lengths.The college administration decides to standardize this unique id on the ID card by regrouping the letters of the previous unique id to a fixed group length.The college administration also does not want to have lowercase letters in the new id .You need to help the college administration with this task.Given the previous id, and the n0.of characters to group (group length),you need to generate the new id.NOTE: While generating the unique id,group the characters from right to left.
INPUT: The first line contains a string S representing a unique id.
Second line contains an integer N representing group length.
OUTPUT: Output should be a single string representing the new unique id.
INPUT:
2-4A0r7-4k
3
OUTPUT:
24-A0R-74K
INPUT:
5F3Z-2e-9-w
4
OUTPUT:
5F3Z-2E9W
#Hi sir We need Exact answer we believe your Experience
Number of moves:
you are given a nxn square chessboard with one bishop and k number of obstacles placed on it. A bishop can go to different places in a single move. find the total no.of places that are possible for the bishop in a single move. Each square is referenced by a type describing the row, R, and column, C, where the square is located.
explanation: given N=6 K=2
bishop position 5 2
obstacle positions (2 2), (1 5)
the bishop can move in so o/p is 6
I/p:
6 2
5 2
2 2
1 6
O/p:
6
I/p:
6 4
3 3
1 3
3 1
5 1
1 5
O/p:
7
Word Rearrange: In word Rearrange players try to score points by forming words using the letters from a 6-letters scrambled word.Given some guessed words,find the total No.of points the players scored in a particular round using the following rubric. 3-letter words are 1 pt, 4-letter words are 2 pts, 5-letter words are 3 pts, 6-letter words are 4 pts+50 pt bonus. A guessed word is invalid if the characters are not present in the scrambled word.Notes-that invalid words count as 0. your task is to find out the final score.
INPUT: The first line contains a string representing a scrambled word. The Second Line contains some spaces-separated strings representing words guessed by the player.
INPUT:
rceast
cat create sat
OUTPUT:
2
INPUT:
tacren
trance recant
OUTPUT:
108
F&W Sdn Bhd is a packaging company. Write a program in C++ to help the company determines how many boxes that are needed for an item. For example, a box of shampoo can have 30 bottles in it. So, 95 bottles of shampoo need to be packed into 3 boxes and 5 are left. The number of each item and the number of an item that can be packed in a box are received as inputs. Display the number of boxes needed and the number of leftover items.
Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use a character
array to store the string.)
(Must be implemented using dynamic array)
// Use c++ language and must use Standard Library List ( STL ) in your program
Please write class for hash table using chaining and it must contain the following functions:// Must use Standard Library List ( STL ) in your program
a two dimensional array with two rows and 3 culumn
Create the class Employee that has the following member data: employee id, employee name, gender, date of birth, address, contact number, date hired, employee type, position, and salary rate. Define all the accessors and mutators needed for the member data of this class. Test the class by creating an object in the main function and try changing or displaying the values of its member data through its accessors and mutators.