The function's only behavior should be to return the sum of array userVals' elements. What common error does the function make?
Assume userVals always has exactly 10 elements.
int SumArray Elements(int uservals[]) {
for (i = 1; i <10; ++i) {
userVals[i] = userVals[i] + userVals[i - 1]; } return userVals[i]; }
A. Attempts to access an invalid element.
B. Omits the first element from the sum.
C. Modifies userVals' elements.
D. Omits the last element from the sum.

Answers

Answer 1

Answer:

A. Attempts to access an invalid element.

Explanation:

The C program above is supposed to loops 10 times to get the total of the userVal's element, but the loop is assigning the cumulative sum of the to each nth index of the userVal array. Although the cumulative total of the array is assigned to the last index, the return statement is attempting to return an invalid element (since i is local only to the for loop statement). The program should return the userVal[9] instead.


Related Questions

Write a Python program to keep track of data for the following information in a medical clinic: doctors, patients, and patient_visits

Patients and Doctors have an ID, first name, and last name as common attributes. Doctors have these additional attributes: specialty (e.g. heart surgeon, ear-nose-throat specialist, or dermatologist), total hours worked, and hourly pay. Further, doctors keep track of the patient_visits. A patient_visit has the following attributes, number_of_visits to the clinic, the patient who is visiting, the doctor requested to be visited, and the number of hours needed for consultation. Based on the number of consultation hours, the doctor will get paid.


The following functions are required:

1. addVisit: this function adds a patient_visit to the doctor. A new visit will NOT be added if the doctor has already completed 40 hours or more of consultation. If this happens, an error is thrown mentioning that the doctor cannot have more visits this week.

2. calculatePay: this function calculates the payment for the doctor using the following logic: Each hour is worth AED 150 for the first two visits of the patient and all further visits are billed at AED 50.


3. calculateBill: this function calculates the bill for the patient, which displays the doctor's details, patient details, and payment details. An additional 5% of the total is added as VAT.


The student is required to identify classes, related attributes, and behaviors. Students are free to add as many attributes as required. The appropriate access modifiers (private, public, or protected) must be used while implementing class relationships. Proper documentation of code is mandatory. The student must also test the code, by creating at-least three objects. All classes must have a display function, and the program must have the functionality to print the current state of the objects.

Answers

This is too much to understand what you need the answer too. In my opinion I can’t answer this question

Write a program that takes two decimal numbers as input and print the largest. If the numbers are equal, print one of them.

Answers

print(max(float(input("Enter a decimal number: ")),float(input("Enter a decimal number: "))))

This would be the simplest way to do it. Best of luck.

A method used to return the value of one of the attributes of an object is called a/an:________

a. retriever (finder)
b. constructor (maker)
c. accessor (getter)
d. mutator (setter)

Answers

Answer:

a. retriever (finder)

Explanation:

In Macintosh computers, the Finder or retriever is a desktop interface. It can be used to find, navigate, open, delete, copy or move files and can open files or folders around the desktop. When the Finder is relaunched, it simply starts the application. It is a method used to return the value of one attributes of an object. It is also called as retriever.

What is Microsoft PowerPoint?
Oa presentation program included with Microsoft Office
oa project management program available only in certain versions of Microsoft Office
Oa desktop publishing program included with Microsoft Office
oa collaboration program available only in certain versions of Microsoft Office

Answers

Answer:

ITS THE FIRST ONE :)

Explanation:

ALSO IF ITS NOT THE FIRST ONE GO ON YT!

What is the best use of network in homes

Answers

Answer:

Spectrem

Explanation:

Relatively simple CRUD (create, read, update, delete) web applications development can be facilitated with: _________.
a. HTTP
b. HTTPS
c. Web Application Frameworks
d. Cascading Style Sheets (CSS)
e. Document Object Model (DOM)

Answers

Answer:

c. Web Application Frameworks

Explanation:

Web Application Frameworks is a form of a software framework that is made to perform support for the building of web applications such as web services, web resources, and web APIs. Web frameworks.

Also, Web Application Frameworks automatically perform the function of primary activities carried out in web development such as create, read, update, delete.

Hence, in this case, the correct answer is Web Application Framework.

On line two, you take a string, word, as input. Then, using that string...
1. In the first line of your output, print the third character of this string.
2. In the second line, print the second to last character of this string.
3. In the third line, print the first five characters of this string.
4. In the fourth line, print all but the last two characters of this string.
5. In the fifth line, print all the characters of this string with even indices
(remember indexing starts at 0, so the characters are displayed starting
with the first)
6. In the sixth line, print all the characters of this string with odd indices
(1.e. starting with the second character in the string).
7. In the seventh line, print all the characters of the string in reverse order.
8. In the eighth line, print every second character of the string in reverse
order starting from the last one.
9. In the ninth line, print the length of the given string,

Answers

Answer:

7

Explanation:

This one obtains results that the others in particular do not have, whether it is even one more word or another initial sentence

Write one kid-friendly paragraph about a Software Developer's salary,.

Answers

According to BBC America, Software Developers made a median salary of $103,620 in 2018. The best-paid 25 percent made $130,460 that year, while the lowest-paid 25 percent made $79,340. The software developer field is growing in both salary and job volume. The BLS projects the software development (applications) field will grow by about 26% by 2028, with 241,500 jobs added by that time. This is compared with an estimated 12% growth for those in computer occupations.

Which Cisco IOS command will permit the engineer to modify the current configuration of the switch while it is powered on?

Answers

Configure terminal because Commands in this mode are written to the running configuration file as soon as you enter them (using the Enter key/Carriage Return). After you enter the configure terminal command, the system prompt changes from switch# to switch(config)#, indicating that the switch is in configuration mode.

Suppose that a t-shirt comes in five sizes: S, M, L, XL, XXL. Each size comes in four colors. How many possible t-shirts are there?

Answers

Answer:

120

Explanation:

This question is basically asking how many ways can we arrange 5 sizes of shirts if they come in 4 colors.

5 permutation of 4

To find permutation, we use the formula

P(n, r) = n! / (n - r)!

Where

n is the size of the shirts available, 5

r is the color of each shirt available, 4

P(5, 4) = 5! / (5 - 4)!

P(5, 4) = (5 * 4 * 3 * 2 * 1) / 1!

P(5, 4) = 120 / 1

P(5, 4) = 120

Therefore, the total number of shirts available is 120

If a computer reboots itself on its own, the computer might have a(n) access problem. hardware problem. Internet problem. software problem.

Answers

Answer:

D) Software problem

Explanation:

plz give me brainliest

D

edge2021      YWWWWWWWWWWWWWWWWWWWWW                                  

What is better to use for start Python or Java?

Answers

Answer:

here is your answer ......

hope it helps......

Answer:

python is better

Explanation:

because its my favourite

8. Write the examples of freeware and Shareware softwares ?

Answers

Explanation:

People use freeware software because it is available free of cost and it can be distributed free of cost, that is why it is called FREEware.

Freeware software:

Adobe PDF

yahoo messenger

Go.ogle Talk

MSN messenger

People use shareware software because it helps them to know about the product more before buying it and this software is available free of cost.

Shareware software:

Adobe acrobat 8 professional

Winzip

Getright

The National Vulnerability Database (NVD) is responsible for actively performing vulnerability testing for every company's software and hardware infrastructure. Is this statement true or false?A. TrueB. False

Answers

Answer:

False

Explanation:

The answer to this question is false. This is because the NVD doesn't perform such tests on their own. Instead they they rely on third-party vendors, software researchers, etc to get such reports and do the assignment of CVSS scores for softwares

The National Vulnerability Database (NVD) is the United State governments leading resource for software vulnerability

What is the main reason for assigning roles to members of a group?

Answers

So that people with strengths in different areas can work on what they do best, plus it divides the workload.

Pig Latin is ______ and fits very naturally in the pipeline paradigm while SQL is instead declarative.
a) functional
b) procedural
c) declarative
d) all of the above

Answers

Answer:

Option b) is correct

Explanation:

Pig Latin is a language game in which English words are altered either by adding a suffix or such kind of suffix can be created by adding a syllable (vocalic). For example, ''hello'' becomes ''ello-hay''.

Pig Latin is procedural and fits very naturally in the pipeline paradigm while SQL is instead declarative.

The question is in the photo

Answers

Answer:

a

the most suitable answer

Is anyone else having an issue with brainly mobile, where they don't let you watch ads? If so, what do you do to fix it?​

Answers

Answer:

no im not

Explanation:

but i sorry that you are

What is the name for non-paid active links returned by an Internet search engine in the search results?
O sponsored links
O organic links
O dead links
O relevant links

Answers

Answer: b

Explanation:

Unless otherwise specified, entire arrays are passed __________ and individual array elements are passed __________.

Answers

Answer:

By reference ; by value

Explanation:

An array is defined as the arrangement of a certain item in a well orderly manner/ fashion.

Unless otherwise specified, entire arrays are usually passed by reference and individual array elements are passed by value which is the standard norm in the mode of operations.

Use the drop-down tool to select the phrase that completes each sentence,
In Windows, deleted files go to the
If you want to see the most information about a file, you can view them in
A file manager can help you
DONE
I

Answers

Answer:

1. recycle bin

2. details view

3. move a file

Explanation:

i did the assignment on edge. and got it right

Answer:

In Windows, deleted files go to the

✔ Recycle Bin

If you want to see the most information about a file, you can view them in

✔ details view

A file manager can help you

✔ move a file

Explanation: Hope it helps ^w^

2. The Warren Commission investigated the assassination of President _______________________ in 1964.

Answers

Answer:

President Kennedy

Explanation:

John F. Kennedy was the 35th President of US. He was assassinated in 1963 in Dallas

Always place the smallest dimensions ____ the object, with ____ the object.
Question 2 options:

A) closest to; progressively smaller dimensions outward from

B) closest to; progressively larger dimensions outward from

C) farthest from; progressively smaller dimensions above

D) farthest from; progressively larger dimensions above

E) none of the above

Answers

The answer is B (Closest to; progressively larger dimensions outward from

1. Normal view
the place where information for handouts can be added
2. Notes view
provide rows of icons to perform different tasks
3. Slide pane
the working window of a presentation
4. Title bar
displays thumbnails
5. toolbars
provides filename and Minimize icon

Match the feature to its function.

Answers

Answer:

1.- display thumbnails, 2.-the place where info can be put, 3.- working window of presentation 4.- provides file name, 5.- rows of icons to perform task ... I'm not sure if these are correct but I tried

1. Normal view

the working window of a presentation

2. Notes view

the place where information for handouts can be added

3. Slide pane

displays thumbnails

4. Title bar

provides filename and Minimize icon

5. Toolbar

provide rows of icons to perform different tasks

What is the missing line of code?

>>> phrase = "You are amazing!"
>>> _____
'u a'

phrase[3:6]

phrase[2:6]

phrase[3:5]

phrase[2:5]

Answers

Answer:

phrase[2:5]

Explanation:

Given:

The above code segment

Required

Which instruction returns 'u a'

First, we need to get the index of u in the phrase:

u is at the third position but in programming, index starts at 0.

So, u is at index 2

Next, we need to get the index of a in the phrase:

a is at index 4

One of the ways to return a sub string from a string in python is [tex]string[start:stop+1][/tex]

Where:

[tex]start = 2[/tex] ----- index of u

[tex]stop = 4[/tex]  ----- index of a

phrase ---- The string variable

So, the instruction that returns 'u a' is: [tex]phrase[2:5][/tex]

Where 5 = 4 + 1

Answer:

phrase[2:5]

Explanation: got it right on edgen

an event handler is..

a. a word that is open for interpretation.
b. a sentence that provides information.
c. a procedure that occurs as a result of a users action or another source.

Answers

The answer here is C

Answer:

The correct answer is:

Option c. a procedure that occurs as a result of a users action or another source.

Explanation:

First of all, let us define what an event is.

An occurrence that is caused by any external user or entity towards a software or a website is called an event i.e. click from mouse, key pressed from keyboard.

When an event occurs, the software or functionality of the website has to respond to the event. An event handler is a function or procedure that contains the code which has to be run when the event occurs.

When the event occurs, the event handler for particular event is executed.

So from the given options,

The correct answer is:

Option c. a procedure that occurs as a result of a users action or another source.

What is the purpose of a Hyperlink

Can you answer both

Answers

Answer:

Number 16 is A Or B And Number 17 is B I think

Explanation:

Assume the clock for a 4-bit binary counter is 80 kHz. The output frequency of the fourth stage (Q3) is

Answers

Answer:

5kHz

Explanation:

There are four stages so N = 2⁴ = 16.

The frequency at nth stage is given by

[tex]f_n = \frac{f_{clk}}{N} = \frac{80kHz}{16} = 5kHz[/tex]

The output frequency of the fourth stage (Q3) is 5kHz. Thus the correct option is A.

What is a 4-bit binary counter?

On each clock cycle, the 4-bit synchronous counter successively counts up from 0 (0000) to 15 as outputs ( 1111 ). It is also known as a 4-bit Synchronous Up Counter as result.

We required four Flip Flops to create a 4-bit counter, as indicated by the number 4 Flip Flops. The counter also has a reset pin, which enables it to enter an all-zero mode in which its output is "0."

The Q output of the previous flip-flop triggers the CLK input in the 4-bit counter above, as opposed to the Q output as in the up counter configuration, where the output of each flip-flop changes state on the rising edge.

There are four stages so N = 2⁴ = 16.

The 4-bit binary counter is 80 kHz.

In order to calculate the output frequency the  4-bit binary counter is divided by 16 which is equal to 5kHz.

Therefore, option A  is appropriate.

Learn more about the 4-bit binary counter, here:

https://brainly.com/question/29894384

#SPJ5

The complete question is Probably

Assume the clock for a 4-bit binary counter is 80 kHz The output frequency of the fourth stage (Q3) is. a) 5kHz. b) 10 kHz. c) 20 kHz. d) 320 kHz.

Designing the right elements for the tasks that the user is attempting to perform is called ________.

Answers

Answer:

Interface design

Explanation:

INTERFACE DESIGN are design that are carried out on either a computer or a mobile phone or other devices that will suit the users by designing the style of the devices and how the device will look like which will inturn enable the user to easily carried out or performed any tasks they are want to perform with easy and without any lapses which is why it is important for INTERFACE DESIGN to be design with the right tools that the user can easily understand in order to access and perform their tasks effectively.

MVC stands for Model-View-Controller. Where is business data and logic mainly kept?
Views
Controllers
Models
None of the above

Answers

Answer:

Controllers

Explanation:

Business Logic goes to Model part in MVC . Role of Model is to contain data and business logic. Controller on the other hand is responsible to receive user input and decide what to do. A Business Rule is part of Business Logic .

Other Questions
There is only one type of scale. True False Deep currents are caused byO A) continental barriers.O B) the Coriolis effect.O C) global wind belts.OD) differences in density of ocean water. Q-3 Why are Plato, Aristotle and Socrates famous eventoday? Simplify: 3(r + 12r2) 2(r + 8) Cl2 +NaBr-NaCl +Br2 5. Choose the word or phrase that best defines the italicized word. "I looked at the sea of yellow faces above the garish clothes..." (1 point) expensive gaudy plain warm Which substance may lower air temperatures after a volcanic eruption?lavasulfur dioxidecarbon dioxidewater vapor I will give brainleist! Please help on all its my homework i dont know how to do there are 12 boys and 16 girls Marco's class (including Marco). what is the probability that a chosen at random from Marco's class will be a boy? Select the correct answer.You're given side AB with a length of 6 centimeters and side BC with a length of 5 centimeters. The measure of angle A is 30%. How manytriangles can you construct using these measurements?.0.1C.2D. infinitely many what is 7x+3(8x-7) I need it in standard form (LOTS OF POINTS) Please just help me!!! I need examples of Both Negative/ Positive effects video games have towards children PLZZZZZZZZZZZZ HELP ME WITH THIS I WILL MARK YOU Find the unit rate.21 grams of fat in 3 servingsThe unit rate isg/serving. The speakers wooden laugh suggests that Why did the Adams administration pass the Alien and Sedition Acts? what is the purpose of the body paragraphs when writing an essay? Write the equation of the line fully simplified slope intercept form. mf hussain made beautiful paintings. is transitive or intransitive