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
Marrrta [24]
3 years ago
10

// PrintStrings // Traverse the 2D character array "strings" and print each of the contained strings.// See the example outputs

provided in the word document. Your output should match the example outputs.void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]){}
Computers and Technology
1 answer:
anzhelika [568]3 years ago
6 0

Answer:

C++.

Explanation:

void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]) {

   // Multi dimension array can be traversed through multi-level loops

   for (int i = 0; i < NUM_STRINGS; i++) {

       for (int j = 0; j < STRING_LENGTH; j++) {

           cout<<"<<strings[i][j]<<";

       }

       cout<<endl;

   }

}

Output would be like this, depending on the size of NUM_STRINGS;

"One"

"Two"

"Three"

....

You might be interested in
. What is piracy? ???????????????????​
Delicious77 [7]

Answer: a practice similar to piracy but in other contexts, especially hijacking.

"air piracy"

the unauthorized use or reproduction of another's work.

Explanation:

8 0
3 years ago
Create a brief program that demonstrates use of a Java exception. For example, you could use InputMismatchException and ask the
HACTEHA [7]

Answer:

Here is the program that demonstrates the use of JAVA exception:

import java.util.Scanner;  //to accept input from user

public class Main {  //class name

   public static void main(String[] args) {  //start of main method

      Scanner input = new java.util.Scanner(System.in);  //creates Scanner class object to accept input from user

       int number1 = 0;  //stores the first integer value

       int number2 = 0;  //stores the second integer value

       while(true) {  //keeps looping until user enters integer value

           System.out.println("Enter 2 integers to perform addition: "); //prompts user to enter two integer values

           try {  //defines a chunk of code to check for errors        

               number1 = input.nextInt(); //reads input integer 1

               number2 = input.nextInt(); //reads input integer 2                  

               break;             }  

           catch (java.util.InputMismatchException e) { // defines a code chunk to execute if an error occurs in the try code chunk

              System.out.println("Input must be an integer "); //displays this message if user enters anything other than an integer value

              input.nextLine();              }         }  // reads input from user again until user enters both integer type values

       System.out.println("The sum is: " + (number1+number2));      }  } //if user enters 2 integers then computes and displays the sum of two integer values

Explanation:

The program uses InputMismatchException exception and asks the user to input two integers and computes the sum of two integers if user enters  integers otherwise an exception InputMismatchException is thrown and a error message Input must be an integer is displayed to the user if they input a string of letters instead o f integer values. Here while loop is used which keeps executing until user enters both the integer values. After the user enters correct values, the sum of the two integers are computed and result is displayed on output screen. The screenshot of program and its output is attached.

Another program asks the user to input an integer and the program executes correctly if they enter an integer but exception InputMismatchException is thrown with an error message that is is displayed to the user if they input a string of letters. Here is the program:

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

       Scanner input = new java.util.Scanner(System.in);

       int number1 = 0;          

       while(true) {

           System.out.println("Enter an integer value: ");        

           try {

               number1 = input.nextInt();  

               break;             }  

           catch (java.util.InputMismatchException e) {

              System.out.println("Input must be an integer ");

              input.nextLine();             }        }  

       System.out.println("The program executed correctly!");  } }

7 0
3 years ago
According to policies and procedures, describe the process to report a hazard?
trapecia [35]
When u r in emergency
7 0
3 years ago
Read 2 more answers
____ was developed to enable web authors to implement interactive content on web sites, such as to animate an item, or pop up a
Gnesinka [82]
HTML (Hypertext Markup Language) was developed to enable web authors to implement interactive content on web sites, such as to animate an item, or pop up a window to point to an item. HTML is a standardized system, a program language for creating web sites that t<span>ells the Web browser how to display a Web page's words and images for the user.</span> It is the fundamental language used to develop webpages.


4 0
3 years ago
When an object is falling because of gravity, the following formulacan be used to determine the distance the object falls in asp
ser-zykov [4K]

Answer:

True

Explanation:

When an object is falling under the influence of gravity, the distance of fall as a function of time is given by:

D(t)=ut + 1/2 * a * t^2

Where

u = initial velocity of the object ( = 0 in this case as the object is falling only under gravity),

a = acceleration of the falling object = g = 9.8 m/s^2 which represents the acceleration due to gravity.

Simplifying,

D(t) = 1/2 * g * t^2

6 0
3 years ago
Other questions:
  • Suppose an 80286 microprocessor is in protected mode. How it is switched back
    6·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • in java how do i Write a program that reads a set of integers, and then prints the sum of the even and odd integers.
    6·1 answer
  • Write a program that asks the user how many numbers will be entered and then has the user enter those numbers. When this is done
    7·1 answer
  • Fre.....ee p......oint....s
    15·2 answers
  • The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
    15·1 answer
  • Jason wants to set up his Wi-Fi’s security. He cannot install a central server for authentication. However, he wants to use a pr
    14·1 answer
  • Write an algorithm to get the value of length and breadth of a rectangle from the user and find its area. inn qbasic
    13·1 answer
  • Software piracy is acceptable as it helps us obtain software cheaper or sometimes even for free.
    15·1 answer
  • If there are over 1,000 websites about a certain topic, the information is reliable. A. True B. False
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!