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
love history [14]
3 years ago
8

What is the value of vals[4][1]? double[][] vals = {{1.1, 1.3, 1.5}, {3.1, 3.3, 3.5}, {5.1, 5.3, 5.5}, {7.1, 7.3, 7.5}};

Computers and Technology
1 answer:
Andreyy893 years ago
6 0

Answer:

When the user concludes the value of "vals[4][1]", then it will give an exception of "ArrayIndexOutOfBoundsException".

Explanation:

  • It is because the size of the above array is [4*3] which takes the starting index at [0][0] and ending index at [3][2]. It is because the array index value starts from 0 and ends in (s-1).
  • When the double dimension array size is [5][5], then it will conclude the value of [4][1].
  • The above array have following index which value can be calculated :-- [0][0],[0][1],[0][2],[1][0], [1][1],[1][2], [2][0], [2][1], [2][2],[3][0],[3][1] and [3][2].
You might be interested in
Which attribute of the image tag specifies the URL of an image
DedPeter [7]

Answer:

src attribute of image tag specifies the url of an image.

7 0
3 years ago
Why is timbre an important musical element?
Reptile [31]
It’s used to define the color or sound of a tone .
5 0
3 years ago
Read 2 more answers
Question 1
likoan [24]

Answer:

No Answer by by a third jsjshs

7 0
2 years ago
What should you do if your computer keeps shutting down while working?
Oliga [24]
D is the best answer hope this help my love

5 0
3 years ago
Read 2 more answers
Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of
gulaghasi [49]

Answer:

Hence the complete implementation of python code that reads two files and merges them together.

def merge_file(past_file_path,proposed_file_path, merged_file_path):

   past_file_contents=load_file(past_file_path)

   proposed_file_contents=load_file(proposed_file_path)

   proposed_customer_name = []

   for row in proposed_file_contents:

       proposed_customer_name.append(row[1])

   with open(merged_file_path,'w') as outputf:

       outputf.write("Customer Number, Customer Name, Address\r\n")

       for row in proposed_file_contents:

           line = str(row[0]) +", " + str(row[1]) + ", " + str(row[2]) +"\r\n"

           outputf.write(line)

       for row in past_file_contents:

           if row[1] in proposed_customer_name:

               continue

           else:

               line = str(row[0]) + ", " + str(row[1]) + ", " + str(row[2]) + "\r\n"

               outputf.write(line)

       print("Files merged successfully!")

# reads the file and returns the content as 2D lists

def load_file(path):

   file_contents = []

   with open(path, 'r') as pastf:

       for line in pastf:

           cells = line.split(",")

           row = []

           for cell in cells:

               if(cell.lower().strip()=="customer number"):

                   break

               else:

                   row.append(cell.strip())

           if  len(row)>0:

               file_contents.append(row)

   return file_contents

past_file_path="F:\\Past Customer.txt"

proposed_file_path="F:\\Proposed Customer.txt"

merged_file_path="F:\\Merged File.txt"

merge_file(past_file_path,proposed_file_path,merged_file_path)

8 0
3 years ago
Other questions:
  • .____________ is a way to identify and differentiate goods andservices through use of a name or distinctive design element.
    10·1 answer
  • Frank develops a questionnaire for his study on Internet dating. One of his questions asks, "How do you feel about Internet dati
    14·2 answers
  • Why does my hp computer keep freezing when i move it?
    10·1 answer
  • How do governments correct for negative externalities?
    5·1 answer
  • Write a program which asks the user for their name and age. The program should then print a sentence.
    14·1 answer
  • 80. A .......... is used to read or write data.<br>A. CD B. VDU C. ROM D. RAM​
    6·1 answer
  • The symbol located to the left of a code number that identifies a code description that has been revised is _____.
    12·1 answer
  • Can you predict what changes will come to data storage in the next decade? 
    12·1 answer
  • What option can be used by a system administrator to ensure that dynamic updates are made only by known clients when you have a
    8·1 answer
  • What option in the zone aging/scavenging properties dialog box will prevent dns record time stamps from being updated too often?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!