Create a c++ program the counts and display the odd and even numbers among the ten input values using a two dimensional array.
First row - 10 input numbers
Second row - even numbers
Third row - odd numbers
Create a class named 'Rectangle' with two data members- length and breadth and a function to calculate the area which is 'length*breadth'. The class has three constructors which are:
1 - having no parameter - values of both length and breadth are assigned zero.
2 - having two numbers as parameters - the two numbers are assigned as length and breadth respectively.
3 - having one number as parameter - both length and breadth are assigned that number.
Now, create objects of the 'Rectangle' class having none, one and two parameters and print their areas.
You are given an array A consisting of N integers.
Task
Print the sum of the elements in the array.
Note: Some of the integers may be quite large.
Input Format
Output format
Print a single value representing the sum of the elements in the array.
Constraints
1<=N<=10
0<=a[i]<=10^10
Write a program that lets user enter in a potentially unlimited series of subject marks from 0 to 100. Ensure that the numbers entered are greater than 0 and less than 100. You cannot assume that the user will enter an integer or a float. User can enter both float and integer values. If they input a negative number or a number more than hundred you should continually prompt them to enter a valid number until they do so. When the user enters a the line ”end” you should stop collecting marks.
Then use their input to generate a summary report that includes Total marks, Average mark, Highest mark and the lowest mark. Sample output is given below.
Enter a mark, 0 to 100: apple
That's not a valid mark!
Enter a price, 0 to end: -5
Marks must be positive!
Enter a mark, 0 to 100: 10
Enter a mark, 0 to 100: 20
Enter a mark, 0 to 100: 30
Enter a mark, 0 to 100: 40
Enter a mark, 0 to 100: 50
Enter a mark, 0 to 100: end
Total marks: 150.0
Average marks: 30.0
Highest mark: 50.0
Lowest mark: 10.0
Given class Triangle (in files Triangle.h and Triangle.cpp), complete main() to read and set the base and height of triangle1 and of triangle2, determine which triangle's area is larger, and output that triangle's info, making use of Triangle's relevant member functions.
Ex: If the input is:
3.0 4.0
4.0 5.0where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is:
Triangle with larger area:
Base: 4.00
Height: 5.00
Area: 10.00Write a C++ program that displays the row numbers of a matrix containing at least two even
numbers. First, the program should create a 2D array (5 rows, 5 columns). Then, ask the user to
input values in the matrix or 2D array. After that, program should display row number (or index)
which has less than 2 prime numbers. If no row (of the matrix) contains at least two prime
numbers then the program should display the message “No row found containing two prime
numbers”.
Write a program that creates and then reads a matrix of 5 rows and 5 columns of type int. while
reading; the program should not accept values greater than 100. For any entered value greater
than 100, the program should ask for input repeatedly. After reading all numbers, the system
should find the smallest number in the matrix and its location or index values. The program
should print the smallest number and its location (row and column) and also print their count.
Write a C++ program that creates a 2D array having 4 rows and 4 columns. Then, ask the user to
input values for the 2D array or matrix. After that, the program should calculate transpose of a
matrix. Transpose is basically calculated by changing rows of matrix into columns and columns
into rows. After calculating, display the final matrix.
Please refer new input and output given below, please include the solution
Area of Square
Given an MxN matrix filled with
The first line of input will be containing two space-separated integers, denoting M and N.
The next M lines will contain N space-separated integers, denoting the elements of the matrix.
Input:
3 6
O X X X X X
O X X X X X
O X X X X X
Expected Ouput: 9
Hi, Please refer new input and output as given below. include new input also
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.
Output
Given Input:
4
0 5
1 0
2 10
3 6
4
0 -5
1 0
2 -10
3 -6
Expected Output: 0