explain declaration and initialization of one and two dimensional arrays with example

Answers

Answer 1

The declaration and initialization of arrays involves creating and using the arrays

How to declare an array?

Assume the programming language is Java.

To declare and initialize an array, we make use of:

One dimensional array: Data-Type Array-name [] = {List of array values}Two dimensional array: Data-Type Array-name [] [] = {List of array values}

Assume the array name of the one dimensional array is num, and the data type is integer.

The following can be used to declare and initialize the array to have 5 elements

int num [] = {1,2,3,4,5}

Assume the array name of the two dimensional array is num, and the data type is integer.

The following can be used to declare and initialize the array to have 2 rows and 3 columns

int num [][] = {{1,2},{3,4},{5,6}}

Read more about arrays at:

https://brainly.com/question/22364342


Related Questions

can anyone tell me about Microsoft some important features for partical

Answers

This is the answer from my opinion.

Type the correct answer in the box. Spell the word correctly.

Which firewall monitors traffic from the DMZ to the LAN?

When a DMZ is set up using dual firewalls, the___

-end firewall monitors traffic moving from the DMZ toward the LAN while the ___

firewall monitors the traffic from the Internet toward the DMZ.

Answers

The firewall that monitors traffic from the DMZ to the LAN is the second, or internal (dual-firewall)

Which firewall manages traffic from the DMZ to the LAN?

In this kind of traffic, the second, or internal, firewall is known to be the one that gives room for traffic to move from the DMZ to the internal network.

Note that the dual-firewall approach is seen as a very secure way due to the fact that  two devices have to be compromised before any kind of attacker can be able to gain access into the internal LAN.

When a DMZ is set up using dual firewalls, the web server is placed inside the DMZ and the private network is often placed behind the DMZ.

Learn more about firewall from

https://brainly.com/question/13693641

Define a function FindLargestNum() with no parameters that reads integers from input until a negative integer is read. The function returns the largest of the integers read

Answers

The FindLargestNum program is an illustration of function; where its execution is done when its name is called or evoked

The function FindLargestNum

The FindLargestNum function written in Python, where comments are used to explain each action is as follows:

#Thie defines the FindLargestNum function

def FindLargestNum():

   #This gets the first input

   num = int(input())

   #This initializes the minimum value

   maxm = num

   #The following is repeated until the user enters a negative input

   while num >= 0:

       #This determines the largest input

       if num > maxm:

           maxm = num

       #This gets the another input

       num = int(input())

   #This prints the largest input

   print(maxm)

Read more about functions at:

https://brainly.com/question/24941798

Can someone give me answers for 1-4

Answers

Answer:

you want me help u with this one?

2. The different amount of shades of color

3. The artist had given every marvel or DC or villian the color that fit them and the texture is also very nice in the picture.

4. The artist maybe could make the pic a little bit more high quality cause in the image is sort of blurry and you cant really see the further people that well.

1. What is TRUNC for Delphi
programming language?
Please explain in at least 200
words.

Answers

The Trunc function cut off a floating-point value by removing the fractional part. The Trunc  function often brings back an integer result as it is not a real function.

What is the Trunc function in Delphi?

When you look at the Delphi code, the Trunc function is known to be a fuction that reduces or cut off a real-type value and make it into an integer-type value.

Note that X is a real-type expression and so the Trunc is said to often brings back an Int64 value that is meaning the value of X approximated to zero and when the cut of value of X is not found in  the Int64 range, an EInvalidOp exception is brought up.

Learn more about programming language from

https://brainly.com/question/8151764

Most graphics software programs give you the choice to work in either RGB or CMYK. What are these specifications called?
A.
digital codes
B.
color spaces
C.
computer graphics
D.
artwork

Answers

A - digital codes

Hope I’m right

Answer:B

Explanation:

A desktop is one kind of computer. Name two other kinds?​

Answers

Answer:

Notebook, supercomputer.

Explanation:

Notebooks are laptops, usually low performance.

Supercomputers are the best performing computers in the world.

Answer:

super computers and mainframe computers

Explanation:

these computers were used way before desktop computers

what impact of information communication technology have on the environment about electronic waste, use of electricity?​

Answers

Answer:

When e-waste is exposed to the heat, toxic chemicals are released into the air damaging the atmosphere.

Explanation:

A set of activities that performs across the organization creating as output of values to the customer
a.
Business process
b.
Customer process
c.
Quality process
d.
Software process
e.
Integrated process

Answers

the correct answer is A : Business Process

Which method adds 10 to the right end of the array?
myArray.
insert
(10)

Answers

JavaScript has a set of mutator functions that allow you to modify the contents of an array without referencing the individual elements.To add to to myArray we us the push() method

Adding Elements to an Array

To add to to myArray we us the push() method

(10)

myArray.push(10)

There are two mutator functions for adding elements to an array: push() and unshift(). The push() function adds an element to the end of an array:

var nums = [1,2,3,4,5]; print(nums); // 1,2,3,4,5 nums.push(6);

print(nums); // 1,2,3,4,5,6

var nums = [1,2,3,4,5]; print(nums); // 1,2,3,4,5 nums[nums.length] = 6; print(nums); // 1,2,3,4,5,6

Learn more about arrays here:

https://brainly.com/question/24275089

It would be Array.append(10), so append is the answer.

Intro to Computer Science:
A zero-tolerance policy means that if the employee violates the policy, they will be _____.
promoted
fired
warned
reprimanded

The correct answer is: fired :)

Answers

When a employee violate a zero-tolerance policy they’ll be fired!

A zero-tolerance policy means that if the employee violates the policy, they will be fired. Thus, the correct answer is option B.

What is a Zero-tolerance policy?

A zero tolerance policy is one that penalizes every violation of a stated rule. People in positions of authority are prohibited by zero tolerance policies from exercising discretion or changing punishments to fit the circumstances subjectively. They must impose a predetermined punishment regardless of individual guilt, extenuating circumstances, or history.

Zero tolerance policies are studied in criminology and are used in both formal and informal policing systems worldwide. If an employee violates the policy, there will be no tolerance and they will be fired.

Therefore, a zero-tolerance policy means that if the employee violates the policy, they will be fired.

To learn more about zero-tolerance policy, click here:

https://brainly.com/question/27293242

#SPJ2

A victimless crime is committed when
|. Select 3 options.
someone downloads a pirated song or video
a copyrighted image is used without permission
a stranger accesses your internet banking
a person downloads and uses pirated software
a hacker sells a company's financial statements

Answers

Someone downloads a pirated song or video a copyrighted image is used without permission and a person downloads and uses pirated software.

A victimless crime is committed when a copyrighted image is used without permission 2. a stranger accesses your internet banking 3. a hacker sells a company’s financial statements.

Victimless crimes are illegal acts that break the laws, but there is no single victim of the crime. They are against social values and laws. A copyrighted image is used without permission

Examples are gambling, traffic violations, etc. Thus, Victimless crimes differ from other types of crime because it does not have an identifiable victim. This crime is against laws and social values and beliefs.

To know more about victimless crimes, visit:

brainly.com/question/17251009

#SPJ6

Which of the following are logical functions? Select all the options that apply.

Answers

Answer:

functions (reference)

Function Description

IFS function Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.

NOT function Reverses the logic of its argument

OR function Returns TRUE if any argument is TRUE

If you determine that the hard drive is experiencing excessive use but the Windows Experience Index reports that memory is the system bottleneck, which component do you upgrade first: memory or the hard drive? Why?

Answers

The reason why is it is good to use an Upgrade memory is because low amounts of memory can lead to much use of the hard drive and based n the fact that it is not costly to upgrade memory than to upgrade the hard drive.

What is upgrading memory?

This is known to b an act done so as to improve the performance of a computer.

It is often known as a RAM or system memory upgrade. An upgrade implies that one is adding memory modules along with the ones that were there or replacing the old ones. It is less costly when compared to hard drive upgrade.

Learn more about Upgrade memory  from

https://brainly.com/question/13196228

Which tags should be bolded?

Answers

Explanation:

As per the nature and importance of the context the certain words can be bolded to make them prominent.

It also refers to the type of sentence either .

negative interrogative simple sentence

QUESTION
1.1 List 10 TEN advantages of word processing.

Answers

Quality : It produces error free documents. The spell and grammar check in word processing makes the document to be neat and error-free. We can get multiple copies of excellent formatted nature in word Processing.

! Storage of Text : We can take any number of copies with word processor. Not only that, if we need the same document with some slight changes, we need not type the same letter again. Just by making some slight changes, we can obtain a modified copy easily.Time Saving : We can get any number of copies of document in future without retyping. We can get the copy of document on any printer.

! Security : We can protect the documents in word processing by giving passwords. So there is a less chance of viewing the documents by unauthorized persons.

! Dynamic Exchange of Data : We can have dynamic exchange of objects and pictures from other documents into word processing documents. The documents can be linked to each other. 

Improving Efficiency and Accuracy. Besides simply saving time, word processing offers ways to improve workers' efficiency and accuracy. Word processors contain software to automatically correct common errors and identify misspellings, improving overall speed and reducing

these may be some of them

"You have created a Word document named apple.docx using Microsoft Word. What type of a file is apple.docx ? Select all that apply"

Answers

The type of a file that is in  apple.docx is Executable program file.

What is an executable file?

An executable file (EXE file) is known to be a type of computer file that has a encoded sequence of codes or instructions that the system often work on  when the user is said to clicks the file icon.

Note that Executable files are known to have an EXE file extension, and there are a lot of other executable file formats. The type of a file that is in  apple.docx is Executable program file.

Learn more about Word document from

https://brainly.com/question/25567167

// This pseudocode segment is intended to compute and display
// the average grade of three tests for any number of students.
// The program executes until the user enters a negative value
// for the first test score.
start
Declarations
num test1
num test2
num test3
num average
housekeeping()
while test1 >= 0
mainLoop()
endwhile
endOfJob()
stop

housekeeping()
output "Enter score for test 1 or a negative number to quit"
return

mainLoop()
output "Enter score for test 2"
input test2
average = (test1 + test2 + test3) / 3
output "Average is ", average
output "Enter score for test 1 or a negative number to quit"
input tesst1
return

endOfJob()
output "End of program"
return

Answers

The pseudocode to calculate the average of the test scores until the user enters a negative input serves as a prototype of the actual program

The errors in the pseudocode

The errors in the pseudocode include:

Inclusion of unusable segmentsIncorrect variablesIncorrect loops

The correct pseudocode

The correct pseudocode where all errors are corrected and the unusable segments are removed is as follows:

start

Declarations

     num test1

     num test2

     num test3

     num average

output "Enter score for test 1 or a negative number to quit"

input test1

while test1 >= 0

     output "Enter score for test 2"

     input test2

     output "Enter score for test 3"

     input test3

     average = (test1 + test2 + test3) / 3

     output "Average is ", average

     output "Enter score for test 1 or a negative number to quit"

     input test1

endwhile

output "End of program"

stop

Read more about pseudocodes at:

https://brainly.com/question/11623795

Which programming term describes the value that is passed to a method when called
so that the method knows what to do?
A parameter
An argument
A function
A variable

Answers

The programming term that describes the value that is passed to a method when called so that the method knows what to do is an Argument

What is an  Argument?

An argument in Programming are variables used to specify a value when you want to call a fuhnction which provides the programs utilizing more informathion.

A bettrer understanding is as follows:

create a function, pass in data in the form of an argumentProgram utilizes more information from the value of the argument.

For example

Say you want to create a function that describes how much money you're having; We can use artgument to descriptive as possible.

Before now, the function may have looked like:

string howMuchmoney() {

    return "so much money";

Modifying  the function prototype and implementation to take a string argument, it becomes

string howMuchmoney(string amount);

Change your return statement to:

return amount + "money";

Add a string to the parentheses where you call the function:

howMuchmoney("tons of")

Learn more in using Argument here:https://brainly.com/question/6067168

PLS HELP In VPython, finish the code to draw a horizontal axis.

origin = vector (0, 0, 0)
axis = cylinder(pos=origin, axis=vector(________)

options are (50, 0, 0), (0, 50, 0) and (0, 0, 50)
its NOT (0, 50, 0)

Answers

Use the knowledge in computational language in python to write a code that draw a horizontal axis with vectors.

How to define vectors in Python?

In Python it is possible to define a vector with characters, forming a word, that is, a string of characters, which is abbreviated as "string". To do this, you can assign it as a constant or read the data as a word.

So in an easier way we have that the code is:

mybox = box(pos=vector(x0,y0,z0),

           axis=vector(a,b,c)

length=L,

height=H,

width=W,

up=vector(q,r,s))

See more about python at brainly.com/question/18502436

Sorry for being late, but the answer is...

50, 0, 0

PROOF:

A team member who does not feel comfortable disagreeing with someones opinion in front of the team would most likely come from a

Answers

Answer:

discussions and decisions made about public policy

Explanation:

Develop a program to sort a file consisting of bonks details in the alphabetical order of author names. The details of books include book id, author_name, price. no of pages, publisher, year of publishing
Please provide C++ program for above question.​

Answers

Use the knowledge in computational language in C++ to write the a code with alphabetical order of author name.

How to define an array in C++?

An Array is a set of values ​​arranged in lists and accessible through a positive numeric index. So, we have that each position of our Array is a variable of the type of our Array, so we have to have a way to initialize this set of variables.

#include <iostream>

#include <iomanip>

#include <fstream>

#include <string>

using namespace std;

struct Book {

   string title;

   string author;

};

const int ARRAY_SIZE = 1000;

Book books [ARRAY_SIZE];

string pathname;

ifstream library;

int LoadData();

void ShowAll(int count);

void ShowBooksByAuthor(int count, string name);

void ShowBooksByTitle(int count, string title);

void sortByTitle(int count, string title);

void sortByAuthor(int count, string author);

int main()

{  

   int count = 0;

   char selector = 'q', yesNoAnswer = 'n';

   string name;

   string title;

     cout << "Welcome to Forrest's Library Database." << endl;

   cout << "Please enter the name of the backup file: ";

   getline(cin, pathname);

   LoadData();

   count = LoadData();

   cout  << count << " records loaded successfully." << endl;

   do

   {

       cout << endl << "\t(S)how All, Search (A)uthor, Search (T)itle, (Q)uit: ";

       cin >> selector;

       selector = toupper(selector);

       switch(selector)

       {

           case 'S':

               sortByTitle(count, title);

               if (count <= 0)

                   cout << "No counts found!\n";

               else

                   ShowAll(count);

               break;

           case 'A':

               sortByAuthor(count, name);

               cout << "bookAuthor: ";

               cin.ignore();

               getline(cin, name);

               if (count <= 0)

                   cout << "No records found!\n";

               else

                   ShowBooksByAuthor(count, name);

               break;

           case 'T':

               sortByTitle(count, title);

               cout << "bookTitle: ";

               cin.ignore();

               getline(cin, title);

               if (count <= 0)

                   cout << "No records found!\n";

               else

                   ShowBooksByTitle(count, title);      

               break;

       }

   }

   while (selector != 'q' && selector != 'Q');

   return 0;

}

int LoadData()

{

   int count = 0;

   int i = 0;

   library.open(pathname);

   ifstream library(pathname);

   if (!library)

   {

       cout << "Cannot open backup file" << endl;

       return 0;

   }

   while (!library.eof())

   {

       getline(library, books[count].title);

       getline(library, books[count].author);

       count++;

   }

   return count;

}

void ShowAll(int count)

{

   for (int i = 0; i < count; i++)

   {

      cout << books[i].title << " " << "(" << books[i].author << ")" << endl;

   }

}

void ShowBooksByAuthor(int count, string name)

{

   int j = 0;

   for (int i = 0; i < count; i++)

   {

       if(books[i].author.find(name) < 100)

       {

           cout << books[i].title << " " << "(" << books[i].author << ")" << endl;

           j++;

       }

   }

   cout << j << " records found";}

void ShowBooksByTitle(int count, string title)

{

   int j = 0;

   for (int i = 0; i < count; i++)

   {

       if(books[i].title.find(title) < 100)

       {

           cout << books[i].title << " " << "(" << books[i].author << ")" << endl;

           j++;

       }

   }

   cout << j << " records found";

}

void sortByTitle(int count, string title) {

   string temp;

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

       for(int j = 0; j < count - i; j++) {

           if (books[j].title > books[j + 1].title) {

               temp = books[j].title;

               books[j].title = books[j + 1].title;

               books[j + 1].title = temp;

           }

       }

   }

}

void sortByAuthor(int count, string name) {

   string temp;

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

       for(int j = 0; j < count - i; j++) {

           if (books[j].author > books[j + 1].author) {

               temp = books[j].author;

               books[j].author = books[j + 1].author;

               books[j + 1].author = temp;

           }

       }

   }

}

See more about C++ at brainly.com/question/19705654

Identify three (3) general-purpose computing devices and write a short (no more than one page) essay explaining in detail the computing process.

Answers

The three general-purpose computing devices are desktops, notebooks, smartphones. The computing process of these devices are further explained below.

What are general-purpose computers?

A general-purpose computer is a type of computer that has the ability to carry out many different tasks. The following tasks can be performed by the general purpose computing devices:

installation of softwares,

processing of data, and

storage of processed data.

The computing process of all the general-purpose computer are the same.

It involves preparation and inputting of data into the computer using the input devices.

The data is sent to the processing unit called the central processing unit (CPU) which has the electronic circuitry that manipulates input data into the information people want.

The information is then displayed in an output device example the monitor, for the user to view.

Therefore, the three general-purpose computing devices are desktops, notebooks, smartphones.

Learn more about computing process here:

https://brainly.com/question/26409104

It is possible to publish a presentation online. True False

Answers

Answer:

It should be true

Explanation:

I don't see why it wouldn't

8. Show that x = xy + xy'
a) Using truth tables
b) Using Boolean identities

Answers

Answer:

B

Explanation:

Cause Show that x =Xy plus xy' is common = is Using Boolean Identify? tY me

Under what scenarios can we clear the NVRAM by moving the PSWD jumper to the RTCRST
pins?

Answers

One can clear the NVRAM by moving the PSWD jumper to the RTCRST pins in the following scenarios:

When the computer system is on for 10 secondsWhen the jumper is set to the closed position

What is a jumper ?

A jumper (usually found on early days computers) is used when the computer needs to close an electrical circuit

The NVRAM which means a non-volatile random-access memory can be reset or clear when the computer system is on for 10 seconds and when the jumper is set to the closed position

Read more about computer at:

https://brainly.com/question/24032221

Ensure that the Facilities worksheet is active. Enter a reference to the beginning loan balance in cell B12 and enter a reference to the payment amount in cell C12.

Answers

A reference value to the beginning loan balance in cell B12 is E6 ($325,000.00) while a reference to the payment amount in cell C12 is $B$6.

What is a spreadsheet?

A spreadsheet refers to a document which comprises cells that are arranged in a tabulated format with rows and columns. Also, a spreadsheet is typically used in various fiedls for calculating, sorting, formatting, arranging, analyzing, and storing data on computer systems.

In this scenario, a reference value to the beginning loan balance in cell B12 would be E6 with a value of $325,000.00 while a reference value to the payment amount in cell C12 would be $B$6.

In conclusion, cell B12 will always show the beginning loan balance and cell C12 will always show a static payment amount for all the other cells in this spreadsheet.

Read more on spreadsheets here: https://brainly.com/question/4965119

Which of the following is a characteristic of TIFFs?

universal standard for image file formats

cross-platform

the one version of TIFF that exists

only available as a vector graphic
please help

Answers

Answer:

What are the characteristics of a TIFF file?

A TIFF file supports grayscale as well as RBG,CMYK, and LAB color space. The format allows a color depth of up to 16 bits per color channel and is therefore ideal for data exchange during a RAW conversion. The abbreviation TIFF, or more rarely TIF, stands for “Tagged Image File Format”.

Answer:

universal standard for image file formats

An onsite technician at a customer site installed a PERC 10 card in an R630 server. The first time the server booted, the customer was unable to see the drives. The customer restarted the server a second time. This time, the server is not booting at all. An issue with the installation of an unsupported PERC card is suspected. What is the next best step to take?

Answers

The next best step to take in the situation above is to remove the failed card from the system and one can use a replacement card to see if the same issue will arise.

What is an IL PERC card?

PERC is a term that connote  Permanent Employee Registration Card. If a person holds this card, it is a card that shows that one have undergone some specific state and federal background checks and fingerprinting to function as a security guard in Illinois.

The Potential employers of security guards is one that needs applicants to have a PERC card and when the card fails, it may be due to the machine or faulty card or corrupt card.

Learn more about installation  from

https://brainly.com/question/17506968

• Do you think documentaries are best delivered in media such as films or documentary?
• Do you think only thru survey can sustain authenticity of the information need within a study?​

Answers

Answer:

I think documentaries are the best delivered in media format because it adds intrigue and lowers boredom.

I think surveys are nice for studies, but not good enough because people can click answers that they know to be false, at least, for them.

Other Questions
NEED HELP ASAP!!!!!!! Pls quickly, its due in 1 hour Find the interquartile range of the data.132.127.106.140.158.135,129,138 The Romanticists rejected certain ideals such as a. the natural worldb. emotional expressionc. individualism and imaginationd. victorian conservatism Mis hermanos y yo ____ Argentina muy bienA. Saben B. SabemosC. SabeisD. Conocemos Which group of words is a dependent clause?a when you think about himb my silly, dreamy sisterc Kim really wanted that catchers gloved to the finish line Why is it necessary to include all people in the mastream of development Write in a sentences. Help help math math math Susan Hammond looks desperate as she bursts in your office. She tells you her husband, Tom, was making fake $100 bills in their spare bedroom. She used a few of the bills to purchase a $350 CatMagic self-flushing litter box. She was arrested late last night by the F.Bl, and charged with the crime of knowingly using counterfeit bills. She needs you to represent her in her criminal case.Is this a federal, state, or concurrent case? Living things can weather rocks by both mechanical and chemical means. true or false A Cu/Cu2+ concentration cell has a voltage of 0.21 V at 25 C . The concentration of Cu2+ in the cathode is 1.6103 molL1 .What is the concentration of Cu2+ in the anode? This is just for me for later Which describes a discount broker?o get reduced prices on shares for their larger customerso pay taxes on a smaller percentage of their earningsO can only buy and sell common stocksO do not give investment advice or do stock market analysis Alexa was out at a restaurant for dinner when the bill came. Her dinner came to $14. After adding in a tip, before tax, she paid $17.78. Find the percent tip. Directions: Select all the correct answers.Which ideas do the passages share?Frederick Douglass spoke to the public about his experiences as a slave inorder to combat slavery.In 1838, Frederick Douglass escaped from slavery in Maryland.Frederick Douglass spoke at an anti-slavery convention in 1841.Frederick Douglass was born as a slave in the United States.OEarly in his career as a speaker, Frederick Douglass was hesitant to speakin front of white people. How is DNA information used to make proteins? What are the steps of this process? Which metaphor creates the most negative mood? A. The school wasa masterpiece that inspired the students tocreate.B. The school was a castle that was ready to enchant the students.C. The school was an obstacle course that left the students tired andconfused.D. The school was an oasis that provided relief from a fast-moving aworld. find the x !please hurry! Thank you! help 8 th grade math A cylindrical specimen of cold-worked copper has a ductility (%el) of 25%. if its cold-worked radius is 10 mm, what was its radius (in mm) before deformation Consider the two-slit interference experiment. Electromagnetic radiation passes through the two slits that are a distance of 0.0170 nm apart. A fourth-order bright fringe forms at an angle of 8.0 degrees relative to the incident beam. What is the wavelength of the light? (1 point)O 581 nmO 420 nmO 789 nmO 591 nm