1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DerKrebs [107]
2 years ago
9

Write a program that creates a two-dimensional array initialized with test data. Use any data type you wish. Declare a two-dimen

sional array of data type char, int, double, or string. Assume the array is declared as follows: const int NUM_ROWS
Computers and Technology
1 answer:
Alona [7]2 years ago
8 0

Question:

Write a program that creates a two-dimensional array initialized with test data. Use any data type you wish. Declare a two-dimensional array of data type char, int, double, or string. Assume the array is declared as follows:  

const int NUM_ROWS = 3,  NUM_COLUMNS = 5;

test data: [10, 1, 1, 1, 1]  [7, 2, 20, 2, 9] [ 3, 3, 3, 3, 5]

Answer:

The program in C++ is as follows:

#include<iostream>

using namespace std;

int main(){

const int NUM_ROWS = 3, NUM_COLUMNS = 5;

int MyArray[NUM_ROWS][NUM_COLUMNS] = {{10, 1, 1, 1, 1},{7, 2, 20, 2, 9},{3, 3, 3, 3, 5}};

return 0;

}

Explanation:

To answer this question, we make use of the following parameters

Array name: MyArray

Array datatype: integer

The explanation is as follows:

This declares the array dimensions

const int NUM_ROWS = 3,  NUM_COLUMNS = 5;

This declares and initializes the array with the test data

int MyArray[NUM_ROWS][NUM_COLUMNS] = {{10, 1, 1, 1, 1}, {7, 2, 20, 2, 9}, {3, 3, 3, 3, 5}};

You might be interested in
Write a Java program that prompts the user to enter integer values for the sides of a triangle and then displays the values and
satela [25.4K]

Answer:

import java.util.Scanner;

public class triangle {

       public static void main (String [] args) {

           int sideOne, sideTwo, sideThree;

           Scanner in = new Scanner (System.in);

           System.out.println("Enter the first side of the triangle");

           sideOne = in.nextInt();

           System.out.println("Enter the secon side of the triangle");

           sideTwo = in.nextInt();

           System.out.println("Enter the third side of the triangle");

           sideThree = in.nextInt();

           if ( sideOne<=0||sideTwo<=0|| sideThree<=0){

               System.out.println(" The Values enter are "+sideOne+ "," +sideThree+ ","+sideThree+ " These values don't make a valid triangle");

           }

           else if ((sideOne + sideTwo> sideThree) || (sideOne+sideThree > sideTwo) || (sideThree+sideTwo > sideOne))

           {

               System.out.println ("The triangle is Valid");

           }

           else {

               System.out.println(" The Values enter are "+sideOne+ "," +sideTwo+ ","+sideThree+ " These values don't make a valid triangle");

           }

       }

Explanation:

for a Triangle to be Valid one of the three sides of the triangle must greater than the other two sides.  The code above enforces this condition using an if statement in combination with the Or Operator

The following conditions where enforced

side one, side two and side three != 0

Side One + Side Three > Side Two

Side Three + Side Two> Side One

Side Two + Side One > Side Three

7 0
3 years ago
How do you run a function in python?
Black_prince [1.1K]
You can call a Python function like so: function(parameters).

Example:

Define function add:
def add(x,y):
return x+y

Call function:
add(3,7) -> 10
3 0
3 years ago
Long Answer Questions: a. Briefly explain the types of Control Structures in QBASIC.​
Alexus [3.1K]

Answer:

The three basic types of control structures are sequential, selection and iteration. They can be combined in any way to solve a specified problem. Sequential is the default control structure, statements are executed line by line in the order in which they appear.

7 0
3 years ago
Your boss asks you to transmit a small file that includes sensitive personnel data to a server on the network. The server is run
mel-nik [20]

Answer:

a. Telnet transmissions are not encrypted.

Explanation:

Indeed, since <em>Telnet transmissions are not encrypted,</em> all the information sent, and even the characters typed in the telnet console are sent in clear text.

This is a security issue, since any other device in the same network will receive a copy of the information (packets) sent. For default, all the devices, except for the server expecting to receive the information, will discard the packets. However it is easy to actively <em>listen </em>and keep those packets, wich will contain the information in plain text and human readable.

4 0
3 years ago
Which of the following sentences use the subjunctive mood correctly?Check all that apply. a. Dr. Franklin wishes he were the one
vredina [299]

Answer:

a. Dr. Franklin wishes he were the one who had invented the new web application.

b. If he were willing to submit the proposal, we might win the bid.

Explanation:

The subjunctive mood is when we're talking about wishes, doubts, and possibilities, in this case, we have two examples, where Dr. Franklin wishes to invent the new web application, and the other sentence is a possibility because he believes that they can win the bid. The last example is an affirmation.

4 0
2 years ago
Other questions:
  • Select all that apply. Hyperlinks can appear as: words pictures symbols trademarks
    12·2 answers
  • If you were given a 3D microscope to use for photography, which object(s) would you most want to photograph?
    10·2 answers
  • Which type of communication is usually handwriten
    11·2 answers
  • Which steps would you take to determine how much an employee should be paid? Select all that apply.
    9·1 answer
  • An automated search feature used by search engines to find results that match your search terms is called a spider or ?
    5·1 answer
  • Help me with this, please. Are vacuum cleaners, Cd players, and telephones considered computers? Do they store any data or proce
    8·2 answers
  • In C!!
    11·1 answer
  • Identify the correct characteristics of Python tuples. Check all that apply.
    9·1 answer
  • "To speed up magnetic hard drive performance , ___________ is often used. "
    15·1 answer
  • The microprogram counter (MPC) contains the address of the next microcode statement for the Mic1 emulator to execute. The MPC va
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!