Part 1 code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[10];
cout<<"Enter 10 Integers "<<endl;
for(int i=0;i<10;i++)
{
cin>>arr[i];
}
int sum=0;
int maximum=INT_MIN;
int minimum=INT_MAX;
for(int i=0;i<10;i++)
{
sum+=arr[i];
if(maximum<arr[i])
{
maximum=arr[i];
}
if(minimum>arr[i])
{
minimum=arr[i];
}
}
cout<<"Sum of 10 integers are
"<<sum<<endl;
cout<<"Minimum value from 10 integers
"<<minimum<<endl;
cout<<"Maximum value from 10 integers
"<<maximum<<endl;
}
part 2 code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int A[2][2],B[2][2],C[2][2];
cout<<"\n";
cout<<"Elements are entered row-wise
\n"<<endl;
cout<<"Enter the values in first matrix \n
"<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cin>>A[i][j];
}
}
cout<<"The values of matrix is A
\n"<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<A[i][j]<<" ";
}
cout<<endl;
}
cout<<"Enter the values in second matrix \n
"<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cin>>B[i][j];
}
}
cout<<"The values of matrix is B
\n"<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<B[i][j]<<" ";
}
cout<<endl;
}
cout<<"The values of matrix C is \n
"<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
C[i][j]=A[i][j]+B[i][j];
}
}
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<C[i][j]<<" ";
}
cout<<endl;
}
}
C++ This week, you are to create two separate programs, first using a simple array and...
Assignment is designed to develop your ability to create static methods and manipulate 1D and 2D arrays in Java. Create a single Java class Matrix and inside the class create the specified static methods as described Task # Description 1 Create a matrix (known components) 2 Create a matrix (random components) 3 Create a matrix from vectors 4 Compare two matrices 5 Add two matrices 6 Subtract two matrices 7 Multiply a matrix by a scalar 8 Multiply two matrices...
Q1. Write a program in Java a. Create 2 separate arrays, of user defined values, of same size b. Add these 2 arrays. ........................................................................................................................... Q2. Write a program in java (using loop) input any10 numbers from user and store in an array. Check whether each of array element is positive, negative, zero, odd or even number. ............................................................................................................................ Q3. Write a program in Java to display first 10 natural numbers. Find the sum of only odd numbers. .............................................................................................................................. Q4....
using C language
Create an array of doubles with 5 elements. In the array prompt the user to enter 5 temperature values (in degree Fahrenheit). Do this within main. Create a user defined function called convert2Cels. This function will not return any values to main with a return statement. It should have parameters that include the temperature array and the number of elements. The function should convert the values for Fahrenheit to Celsius and save them back into the same...
Write a C# program(s) using arrays Create a 2D array of integers [8,4] Create a 3D array of integers [4,4,2]
For the program described below, document your code well. Use descriptive identifier names. Use spaces and indentation to improve readability. Include a beginning comment block as well as explanatory comments throughout. In the beginning comment block, add your name, program name, date written, program description. The description briefly describes what the program does. Include a comment at the beginning of each method to describe what the method does. Write a program to perform operations on square matrices (i.e. equal number...
For the program described below, document your code well. Use descriptive identifier names. Use spaces and indentation to improve readability. Include a beginning comment block as well as explanatory comments throughout. In the beginning comment block, add your name, program name, date written, program description. The description briefly describes what the program does. Include a comment at the beginning of each method to describe what the method does. Write a program to perform operations on square matrices (i.e. equal number...
Write a C++ console application that adds the corresponding elements of two integer arrays of size five. Prompt the user for the ten values and store the first five in the first array and the second five in the second array. Then create and call function matrixAdd that adds the two arrays and prints the five sums. Here is the function prototype: void matrixAdd(int firstArr[], int secondArr[]); [your program code here]*
In C only Please! This lab is to write a program that will sort an array of structs. Use the functions.h header file with your program. Create a source file named functions.c with the following: A sorting function named sortArray. It takes an array of MyStruct's and the length of that array. It returns nothing. You can use any of the sorting algorithms, you would like though it is recommended that you use bubble sort, insertion sort, or selection sort...
Create the following programs in Java {Java1 difficulty} [Please create as simple as possible] a. Ask the user to enter their favorite number and favorite word. Pass both of these values to a method that will print the favorite word vertically the favorite number of times. b. Ask the user to enter 2 integers. Pass the integers to 2 different methods: one method to add the integers and print the sum (from the method); the second method to multiply the...
This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to Using Individual Variables One of the main advantages of using arrays instead of individual variables to store values is that the program code becomes much smaller. Write two versions of a program, one using arrays to hold the input values, and one using individual variables to hold the input values. The programs should ask the user to enter 10 integer values, and then it...