write a program to print the index of the last occurence of the given number N in the list
Suppose you work for an employer that sells vehicles and your employer instructs you to design a program using the C++ language to determine the car that corresponds to the price that your program calculated. The price of the car is determined by adding three(3) prices: which are engine price, colour price and the price based on the colour of the car
given an array of n integers find and print all the unique triplets
Consider the following function fpp.
def foo(m):
if m == 0:
return(0)
else:
return(m+foo(m-1))Which of the following is correct?
The function always terminates with f(n) = factorial of n
The function always terminates with f(n) = n(n+1)/2
The function terminates for nonnegative n with f(n) = factorial of n
The function terminates for nonnegative n with f(n) = n(n+1)/2
Write a program to input name, roll number and marks in 5 subjects for n number of students using structure. Write functions to: -
a. Find total marks and percentage of all n students.
b. Display details of a student with a given roll number.
c. Display the details for all the students having percentage in a given
range.
d. Sort the array in ascending order of marks.
Add two polynomials
Given two polynomials A and B, write a program that adds the given two polynomials A and B.Input
The first line contains a single integer M.
Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.
After that next line contains a single integer N.
Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
Input 1
4
0 5
1 0
2 10
3 6
3
0 1
1 2
2 4
output 1
6x^3 + 14x^2 + 2x + 6input 2
4
0 5
1 0
2 10
3 6
4
0 -5
1 0
2 -10
3 -6
output2
create robot in kotlin Ring the alarm on time Make coffee Heat the water to a suitable temperature Pack your bag (Keep only appropriate books for the day) Cook breakfast and lunch Iron the clothes
Given an integer number N as input. Write a program to print the double triangular pattern of N lines using an asterisk(*) character as shown below.There is space after each asterisk character.
Explanation: N = 4 there should be 2 triangle pattern with 4 lines each.
Build a Quiz App as shown to you in the class.
Use Struct for this purpose.
1)Each question should print one by one.
2)We can select one option
-> If the selected option is correct print "correct answer shabash" and add 5 marks to the total marks
-> If the selected option is wrong then print "Upps Wrong Answer Naliak"
3) At the end of the quiz you should printout Total marks obtained and on the base of those marks tell the candidate if he/she has paased or fail the Test
Numbers in String - 2
Given a string, write a program to return the sum and average of the numbers that appear in the string, ignoring all other characters.Input
The input will be a single line containing a string.Output
The output should contain the sum and average of the numbers that appear in the string.
Note: Round the average value to two decimal places.Explanation
For example, if the given string is "I am 25 years and 10 months old", the numbers are 25, 10. Your code should print the sum of the numbers(35) and the average of the numbers(17.5) in the new line.
Sample Input 1
I am 25 years and 10 months old
Sample Output 1
35
17.5
Sample Input 2
Tech Foundation 35567
Sample Output 2
35567
35567.0