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
Papessa [141]
2 years ago
6

Given an int variable k, an int array incompletes that has been declared and initialized, an int variable nIncompletes that cont

ains the number of elements in the array, an int variable studentID that has been initialized, and an int variable numberOfIncompletes, Write code that counts the number of times the value of studentID appears in incompletes and assigns this value to numberOfIncompletes. You may use only k, incompletes, nIncompletes, studentID, and numberOfIncompletes.
Computers and Technology
1 answer:
Hoochie [10]2 years ago
5 0

Answer:

I will code in Javascript.

Preconditions:

The variables k, incompletes has been declared and initialized.

The variable nIncompletes contains the number of elements of incompletes.

The variable stududentID has been declared and initialized.

The variable numberOfIncompletes has been declared.

Script:

numberOfIncompletes = 0; <em>//initialize numberOfIncompletes</em>

for( k = 0; k < nIncompletes; k++) {

      if(incompletes[k] == studentID){ <em>//if the element of array is equal to studentID</em>

         numberOfIncompletes++; <em>//adds 1 to numberOfIncompletes</em>

      }

}

Explanation:

The script uses a for loop to go through the entire array incompletes, comparing the k variable with nIncompletes and adding 1 on each pass.

Then inside the for, uses an if statement to compare if the actual element is equal to studentID, if equal adds 1 numberOfIncompletes.

You might be interested in
Select the correct answer.
Juliette [100K]

Answer:

COMPRESS, THIS WILL MAKE IT INTO A ZIP

Explanation:

3 0
3 years ago
Blind spots are those areas not reflected in your:
bulgar [2K]
The answer is C because your sideview and rearview mirrors are there specifically to check behind you, while the vanity mirror is not supposed to be used for the same purpose.
8 0
3 years ago
Read 2 more answers
Frank has created a résumé and separated the sections using headings. How can he set the headings apart from normal text?
Pepsi [2]
He could use bold or bigger text just a suggestion.
6 0
2 years ago
CC stand for.....in the email platform?
Elena L [17]
CC stands for Carbon Copy in emails.
6 0
3 years ago
Read 2 more answers
When data can flow across a cable in both directions, this is known as___Communicating?
Ede4ka [16]

Answer:

full duplex communication.

Explanation:

In a duplex type of topology or communication, data or information can be transferred in both directions.

There are two different types of these communications

3 0
2 years ago
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    5·1 answer
  • What is the recommended size for bulleted text?
    5·2 answers
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • Assuming a computer has a single processor and a single core with no support for parallel execution, explain why running a multi
    11·1 answer
  • A technician wants to consolidate and log specific alerts from network devices into a database so maintenance tasks and potentia
    11·1 answer
  • What is the benefit of the load balancing logic to end-user?
    15·1 answer
  • An IT suspects that an unauthorized device is connected to a wireless network. This is a result of pastry sharing on a device br
    13·1 answer
  • Why computer manufacturers constantly releasing faster computers ?
    14·1 answer
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
  • HELP ME ⚠️‼️⚠️‼️ DUE IN EXACTLY 27 MINUTES
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!