Area of Largest Rectangle in Histogram
Given an list of integer
The input will be a single line containing space-separated integers, denoting the heights of the bars.
The output should be a single line containing the area of the largest rectangle in the rectangle.
For example, if the given list of numbers are
2 1 5 6 2 3 , when they are drawn adjacent to each other according to their heights, the histogram will be like The largest rectangle can be found in between 5 and 6, which is 10.
Sample Input 1
2 1 5 6 2 3
Sample Output 1
10
Sample Input 2
65 87 96 31 32 86 57 69 20 42
Sample Output 2
248
Define a class Fixed_Deposit with the following specifications, the program uses three overloaded constructors. The parameter values to these constructors are provided at run time. The user can provide input in the following forms.
1. Amount, period and interest in decimal form.
2. Amount, period and interest in percent form.
3. Amount and period.
PRIVATE DATA MEMBERS:
P_Amount long int type Years integer type Rate float type R_value float type
PUBLIC MEMBER FUNCTIONS:
Fixed_Deposit() Null constructor
Fixed_Deposit(p, y, r=0.12) Parameterized constructor with default arguments to accept values for P_Amount, Years and Rate(in Percent e.g., 0.12, 0.09)
Fixed_Deposit(p, y, r) Parameterized constructor with default arguments to accept values for P_Amount, Years and Rate(in Decimal e.g, 12%, 8%)
display() Function to display the P_Amount and R_Value
~Fixed_Deposit() Destructor to destroy the data objects
Directories in your current workspace
\Home
Files in your current workspace
File Name
Write a program that will calculate a student's year marks for all his subjects. The program must read the subject code, the assignment marks for two assignments and the percentage that each assignment contributes towards the year mark, for each subject that a student is registered for. Create an input file called assignments.dat
Bob a builder has come to you to build a program for his construction business. He needs to determine the square footage of a room in order to buy materials and calculate costs. Bob charges $425 per square metre. The program is going to ask the user to enter the name of a room. It will then ask for the width and length of the room (in meters) to be built. The program will calculate the room area and use this information to generate an approximate cost. Your program will display the room, the total area and the approximate cost to the screen. Using Pseudocode, develop an algorithm for this problem.
Define the class Employee which has ID,name, DOB. Define the default constructor, member functions get_data() for taking the ID,name and DOB of the Employee, print() for displaying the data of Employee.Create an array of employee of size N and write the friend function sort() which sorts the array of employee according to their ID.
Write a program that reads 7 scores as input and outputs the average. The program should use an array of
floats. Note that you need to determine the highest and the lowest score and exclude them in the computation.
In 4 moves, reposition the circles from position 1 to position 2. One move means sliding a circle clockwise, Counter Clockwise, left or right at least touching the nearest 2 circles. Otherwise invalid move.
Link photo
https://www.chegg.com/homework-help/questions-and-answers/coin-please-need-code-algorithm-python-need-working-code-thankyou-screenshot-main-program--q77289194
Palindrome Pairs
Given a list of unique words, write a program to print all the pairs of the distinct indices (i, j) in the given list, so that the concatenation of two words at indices i and j is a palindrome.
The input will be a single line containing a sentence.
The output should be printing each distinct pair of indices (i, j) each in a line in ascending order.
If there are no distinct pairs found, print "-1"
Note: Consider (i, j) and (j, i) as two different pairs.
For example, if the given sentence is
was it a car or a cat I saw
The words that can be concatenated to make a palindrome are
WordsIndices(was, saw)(0, 8)(a, a)(2, 5)(a, a)(5, 2)(saw, was)(8, 0)
Sample Input 1
was it a car or a cat I saw
Sample Output 1
0 8
2 5
5 2
8 0
Time Converter
let's build a Time Converter by applying the concepts we learned till now.
Refer to the below link for time converter question output:
https://drive.google.com/file/d/1C4U14OrAlFE_3ecTsZVZQ8eXiu3g37GN/view?usp=sharing
The above link contains output of the time converter.
For Question refer below link
https://drive.google.com/file/d/1uO1f7KmPNvyPw9zNM5NUk7xLc42fhbYJ/view?usp=sharing
The above link contains Time converter question and explanation
Very Important note (must implement in code):
When values are entered in HTML input elements with ids hoursInput and minutesInput, the HTML button with id convertBtn is clicked, the converted seconds should be shown, and the error message should be empty. Refer below link
https://drive.google.com/file/d/1FlEul4uAyPhAG1bldEHMBTIdDjq5lhRw/view?usp=sharing
Use this Background image:
https://assets.ccbp.in/frontend/dynamic-webapps/time-converter-bg.png
CSS Colors used:
Text colors Hex code values used:
#f5f7fa
#000000
#ffffff
CSS Font families used:
Open Sans
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.
The first line of input will be a sentence.
The second line of input will be an integer L.
The output should be containing the unique concatenated word pairs each in a line in the lexicographical order.
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
Word1Word2toyourtoexamexamtoyourto
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
wentmovie