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
N76 [4]
3 years ago
10

Consider the following code segment.

Computers and Technology
1 answer:
m_a_m_a [10]3 years ago
8 0

Answer:

10 20                                                                                                                          

30 40                                                                                                                          

50 60

Explanation:

Given

The above code segment

Required

What is printed, if anything

To do this, we analyze the code line by line.

Line 1: The first line creates a 4 by 3 array named mat

Line 2: for (int[] row : mat) {  -> This creates row[] array which represents each row of array mat

Line 3: for (int j = 0; j < row.length; j += 2){ -> This iterates through the even indexed elements of the row array i.e. 0 and 2

Line 4: System.out.print(row[i] + " "); -> This prints the even indexed elements of the row array.

The even indexed elements are: 10, 20, 30, 40, 50 and 60

Line 5: System.out.println(); --> This prints a new line

You might be interested in
Which page feature is used in long documents to assist readers in quickly finding information in the document without having to
irakobra [83]

Maybe it is Ctrl-F... is this what you're thinking of?

3 0
3 years ago
Read 2 more answers
Write a program that grades arithmetic quizzes as follows: Ask the user how many questions are in the quiz. Ask the user to ente
kirill115 [55]

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int questions, answer;

   cout<<"Questions: ";

   cin>>questions;

   int answerkey[questions];

   cout<<"Enter answer keys: ";

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

       cin>>answerkey[i];    }

   int correct = 0;

   cout<<"Enter answers: ";

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

       cin>>answer;

       if(answer == answerkey[i]){

           correct++;        }    }

   cout<<"Correct answers: "<<correct<<endl;

   cout<<"Percentage correct : "<<(100 * correct)/questions<<"%";

   return 0;

}

Explanation:

This declares the number of questions and the answers submitted to each equation

   int questions, answer;

Prompt to get the number of questions

   cout<<"Questions: ";

This gets input for the number of questions

   cin>>questions;

This declares the answerkey as an array

   int answerkey[questions];

Prompt to get the answer key

   cout<<"Enter answer keys: ";

This iteration gets the answer key for each question

<em>    for(int i = 0; i< questions; i++){</em>

<em>        cin>>answerkey[i];    }</em>

This initializes the number of correct answers to 0

   int correct = 0;

Prompt to get the enter the answers

   cout<<"Enter answers: ";

This iterates through the answer keys

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

This gets the answer to each question

       cin>>answer;

This compares the answer to the answer key of the question

       if(answer == answerkey[i]){

If they are the same, correct is incremented by 1

           correct++;        }    }

Print the number of correct answers

   cout<<"Correct answers: "<<correct<<endl;

Print the percentage of correct answers

   cout<<"Percentage correct : "<<(100 * correct)/questions<<"%";

7 0
3 years ago
You have been tracking your exercise routine, which involves running, lifting weights, yoga, and stretching. You want to see wha
Harrizon [31]

The best chart to see the data distribution for the exercise routine would be a pie chart. Using Microsoft Excel, you can input each data point you have for all you exercise routine category, and generate a pie chart which will show you the percentage for each category in comparison to the total.


5 0
3 years ago
Read 2 more answers
An isp is a group of updates, patches, and fixes that apply to specific oss.
olasank [31]
<span>The statement that an ISP is a group of updates, patches, and fixes that apply to specific OSs is false.
</span> ISP stands for Internet service provider, while OSS stands for Operations support system.<span> The term ISP denotes a company or</span><span> organization that provides services for accessing, using, or participating in the Internet. OSS on the other hand is used by the providers to manage their networks.
</span>
4 0
3 years ago
Wat kind o mouse pleese hep meh​
Trava [24]

Answer:

It's is a razer Basilisk

4 0
3 years ago
Other questions:
  • Jesse is writing a physics quiz about the motion of a roller coaster cart. He has a clip art illustration of a cart rolling hori
    9·2 answers
  • Two electronics students are discussing static electricity and electric current. Student A says that a basic property of static
    12·1 answer
  • A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of m
    9·1 answer
  • GoInternet, Inc., is an Internet-access service provider that is being forced to manage numerous unwanted e-mail messages from a
    10·1 answer
  • a corporation needs an operating system that allows the various teams in its office to network &amp; collaborate on projects. wh
    11·2 answers
  • The retention of encoded information over time is called storage. A measure of memory storage that involves identifying informat
    5·1 answer
  • What term is used to refer to the requesting of information from a database?
    10·2 answers
  • Whats the answer :)?<br>i will give brainslist​
    11·1 answer
  • Explain the differences between copyright, fair use, and trademark?
    13·1 answer
  • Who tryna trade in gta my psn is xMadOrNawx-_-
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!