Use a Two-dimensional (3x3) array to solve the following problem:
Write an application that inputs nine numbers, each of which is between 1 and 10, inclusive.
[10%] Display the array after the user inputs each value.
[10%] Documentation and the screen shot(s) of the results.
[70 %] Rotate/flip the array by changing places. Make the rows columns and vice versa.
[10%] Remember to validate the input and display an error message if the user inputs invalid data.
Example:
1 2 3
4 5 6
7 8 9
the result will be :
1 4 7
2 5 8
3 6 9
/* PROGRAM IN C++ */
#include<iostream>
using namespace std;
int main(){
int a[3][3]; // declare array
while(1){ // loop until correct matrix is not
given
cout<<"Enter Matrix (Number
between 1 to 10): "<<endl; // message for input
int flag = 0; // to check if number
is valid
for(int i = 0; i < 3; i++){ //
outer loop (row)
for(int j = 0; j
< 3; j++){ // inner loop (column)
cin >> a[i][j]; // input
if(a[i][j] <= 0 || a[i][j] >= 11){ //
check number under 1 to 10
cout<<"Invalid
Value"<<endl;// message if not
flag = 1; // update flag to 1
if not
break; // break inner
loop
}
}
if(flag == 1){
// also break outer loop
break;
}
}
if(flag == 0){ // if valid matrix
entered break from while
break;
}
}
cout<<"Input Matrix: "<<endl; //
message
for(int i = 0; i < 3; i++){ // print input
matrix
for(int j = 0; j < 3;
j++){
cout<<a[i][j]<<" ";
}
cout<<endl; // break line
after 1 row
}
cout<<"\nOutput Matrix: "<<endl; //
message for output matrix
for(int i = 0; i < 3; i++){ // print output
matrix
for(int j = 0; j < 3;
j++){
cout<<a[j][i]<<" "; // transpose matrix
}
cout<<endl; // break after 1
row
}
}
/* OUTPUT */

/* PLEASE UPVOTE */
Use a Two-dimensional (3x3) array to solve the following problem: Write an application that inputs nine...
Java Programming Use a one-dimensional array to solve the following program. Write an application that inputs six numbers [Keep the numbers in an array]. The numbers must be between 20 and 200, inclusive. If the number is not between 20 and 200, ask for another input. When a number is entered, display the number only if it is not a duplicate of a number already entered. If it is a duplicate of a number already entered, display a message that...
create a new Java application called "Scorer" (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and three columns and that uses methods and loops as follows. Use a method containing a nested while loop to get the nine (3 x 3) doubles from the user at the command line. Use a method containing a nested for loop to compute the average of the doubles in each row. Use a method to...
Please help with this C++ problem using Array
Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100. As each number is read validate it and store it in the array. After reading all the values, display only the unique values that the user entered. Make sure you account for the worst case scenario in which all 20 numbers are different. Use the smallest possible array to solve this...
Use C Programming
DESCRIPTION Write a program that: Creates a Dimensional, integer array that holds 8 values Prompts the user to enter 8 integers between 0 and 20 [inclusive) and stores the data in the array Prints the data in array abng with a histogram of the data as shown below. There is no requirement to validate the data. You must use a constant to declare your array and control any loops you need Sample Output: Enter 8 integer values...
This is python3. Please help me out.
Develop the following GUI interface to allow the user to specify
the number of rows and number of columns of cards to be shown to
the user. Show default values 2 and 2 for number of rows and number
of columns. The buttons "New Game" and "Turn Over" span two
column-cells each.
Fig 1. The GUI when the program first starts.
When the user clicks the "New Game" button, the program will
read...
Use a two-dimensional array to solve the following problem. A company has four salespeople (1 to 4) who sell five different products (1 to 5). Once a day, each salesperson passes in a slip for each different type of product sold. Each slip contains the following a) The salesperson number b) The product number c) The total dollar value of that product sold that day Thus, each salesperson passes in between 0 and 5 sales slips per day. Assume that...
P7.5– A theater seating chart is implemented as a two-dimensional array of ticket prices, like this: 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20 20 20 20 20 20 10 10 10 10 20 20 20 20 20 20 10 10 10 10 20 20 20 20 20 20 10 10 20 20 30 30...
I'm a little crunched for time and need some help with these first two questions. Thank you! Question 1.) Write a Java program that reads in sequence of integers from the user until user enters a negative number and stores them in an Integer ArrayList. Once read, display a bar chart based on the values stored in the ArrayList. For example, if the user inputs 2, 5, 3, 8, 4, and -1, then your program should display the bar chart...
Use a two-dimensional array to solve the following problem. A company has four salespeople (0 to 3) who sell five different products (0 to 4). Once a day, each salesperson passes in a slip for each different type of product sold. Each slip contains the following: a) The salesperson number b) The product number c) The total dollar value of that product sold that day Thus, each salesperson passes in between 0 and 5 sales slips per day. Assume that...
Define a two-dimensional int array which has 5 rows and 3 columns. The elements in array is randomly initialized (using Math.random()). Write a method to find the maximum value in this two dimensional array; Write a method to find the average value in the array; Write a method to count how many elements are smaller than average; Write a method to copy contents in a two-dimensional array to a one-dimensional array. The method will return this one-dimensional array. Method is...