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
FinnZ [79.3K]
3 years ago
5

rray testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cred

it is 100, so anything over 100 is extra credit. Ex: If testGrades
Computers and Technology
1 answer:
diamong [38]3 years ago
4 0

Answer:

Replace

/* Your solution goes here */

with

sumExtra = 0;

for (i =0; i<NUM_VALS;i++){

if(testGrades[i]>100){

sumExtra = sumExtra - testGrades[i] + 100;

}

}

Explanation:

This line initializes sumExtra to 0

sumExtra = 0;

The following is a loop from 0 to 3

for (i =0; i<NUM_VALS;i++){

The following if condition checks if current array element is greater than 100

if(testGrades[i]>100)

{

This line calculates the extra credit

sumExtra = sumExtra - testGrades[i] + 100;

}

}

<em>See attachment for complete question</em>

Download docx
You might be interested in
How do i block somebody on here, theyre making me have a panic attack. /srs
spin [16.1K]

Answer:

If someone is disturbing you a lo then you can report him/her.

  • Go to g-mail.
  • Type a message to US Support.
  • Add a screenshot of him/her whom you want to report.
  • Use polite words
  • At last, send it.

You will get soon response.

5 0
2 years ago
Read 2 more answers
How to do the for loop in python
shusha [124]

Answer:

To loop through a set of code a specified number of times, we can use the range() function, The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and ends at a specified number.

Explanation:

hope this helps

8 0
2 years ago
Show the array that results from the following sequence of key insertions using a hashing system under the given conditions: 5,
sergejj [24]

Answer:

a) Linear probing is one of the hashing technique in which we insert values into the hash table indexes based on hash value.

Hash value of key can be calculated as :

H(key) = key % size ;

Here H(key) is the index where the value of key is stored in hash table.

----------

Given,

Keys to be inserted are : 5 , 205, 406,5205, 8205 ,307

and size of the array : 100.

First key to be inserted is : 5

So, H(5) = 5%100 = 5,

So, key 5 is inserted at 5th index of hash table.

-----

Next key to inserted is : 205

So, H(205) = 205%100 = 5 (here collision happens)

Recompute hash value as follows:

H(key) =(key+i) % size here i= 1,2,3...

So, H(205) =( 205+1)%100 = 206%100 = 6

So, key 205 is inserted in the 6th index of the hash table.

----------

Next Key to be inserted : 406

H(406) = 406%100 = 6(collision occurs)

H(406) =(406+1) %100 = 407%100 = 7

So, the value 406 is inserted in 7the index of the hash table.

-----------------

Next key : 5205

H(5205) = 5205%100 = 5(collision)

So, H(5205) = (5205+1)%100 = 6( again collision)

So, H(5205) = 5205+2)%100 = 7(again collision)

So, H(5205) = (5205+3)%100 = 8 ( no collision)

So, value 5205 is inserted at 8th index of the hash table.

-------------

Similarly 8205 is inserted at 9th index of the hash table because , we have collisions from 5th to 8th indexes.

-------------

Next key value is : 307

H(307) = 307%100 = 7(collision)

So, (307+3)%100 = 310%100 = 10(no collision)  

So, 307 is inserted at 10th index of the hash table.

So, hash table will look like this:

Key       index

5         5

205         6

406         7

5205 8

8205 9

307         10

b) Quadratic probing:

Quadratic probing is also similar to linear probing but the difference is in collision resolution. In linear probing in case of collision we use : H(key) = (key+i)%size but here we use H(key) =( key+i^2)%size.

Applying Quadratic probing on above keys:.

First key to be inserted : 5.

5 will go to index 5 of the hash table.

-------

Next key = 205 .

H(205) = 205%100 = 5(collision)

So. H(key)= (205+1^2)%100 = 6(no collision)

So, 205 is inserted into 6th index of the hash table.

--------

Next key to be inserted 406:

So, 406 %100 = 6 (collision)

(406+1^2)%100 = 7(no collision)

So, 406 is moved to 7th index of the hash table.

----------

Next key is : 5205

So, 5205%100 = 5 (collision)

So, (5205+1^2)%100 = 6 ( again collision)

So, (5205+2^2)%100 = 9 ( no collision)

So, 5205 inserted into 9th index of hash table.

-----------

Next key is 8205:

Here collision happens at 5the , 6the , 9th indexes,

So H(8205) = (8205+4^2)%100 = 8221%100 = 21

So, value 8205 is inserted in 21st index of hash table.

--------

Next value is 307.

Here there is collision at 7the index.

So, H(307) = (307+1^2)%100 = 308%100= 8.

So, 307 is inserted at 8the index of the hash table.

Key           Index

5                  5

205                  6

406                  7

5205                9

8205               21

307                   8

3 0
2 years ago
The scene of a human sitting at a computer terminal, responding to stimuli flashed on the computer screen, would most likely be
katrin2010 [14]

I guess the correct answer is information processing

Infοrmatiοn prοcеssing is thе changе (prοcеssing) οf infοrmatiοn in any mannеr dеtеctablе by an οbsеrvеr. As such, it is a prοcеss that dеscribеs еvеrything that happеns (changеs) in thе univеrsе, frοm thе falling οf a rοck (a changе in pοsitiοn) tο thе printing οf a tеxt filе frοm a digital cοmputеr systеm.

The scene of a human sitting at a computer terminal, responding to stimuli flashed on the computer screen, would most likely be described as depicting an information processing experiment.

7 0
2 years ago
Microsoft words spell checker
Degger [83]
The answer it is A i hope is good
3 0
2 years ago
Other questions:
  • A web page created expressly in hopes of ranking well for a term in a search engine's organic/non-paid listings and which itself
    7·1 answer
  • How is sharepoint used in organization today?
    12·1 answer
  • How can website illustrate cooperations and kidness?
    8·1 answer
  • In Windows 7/Vista, the information that establishes basic settings such as the location of the operating system and other key s
    7·1 answer
  • In this website/app what are the points for?
    7·1 answer
  • The World Wide Web (WWW) is a network of links on the Internet to documents containing text, graphics, video, and sound, but doe
    10·1 answer
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • Briefly explain what is net neutrality and why is it important today
    15·1 answer
  • Your network has four Hyper-V hosts, which are running three domain controllers and about 10 member servers. Three of the member
    10·1 answer
  • What is the difference between skew and rotate in the MS Paint application?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!