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]
3 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]3 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
Which of these reduces friction and makes the job of moving a freezer easier?
laila [671]
Using a hand truck to move the freezer would make it easier and remove the element of friction between the freezer and the floor 100%
6 0
2 years ago
IOS 0R ANDR0ID ???
Lera25 [3.4K]

Answer:

Both are awesome!

Explanation:

One thing we shouldn't do is downgrade others for having an android or calling someone basic because they have ios. Both have their pros and cons, but idk because I don't have a phone! Hehe. But my family primarily uses IOS.

3 0
3 years ago
The requirement, "The system shall receive information quickly," is an example of a functional requirement.
olga55 [171]

Answer: False

Explanation: Functional requirement is the requirement in the operating system that gives the description of the functioning and specific action that is done by system.

Thus, receiving the data rapidly is not the form of functional requirement as it does not specifies any function that is to be done and receiving of data is already being done and at faster rate in future.

Performance requirement is the factor that is required for defining that how well a system should perform the function.So, reviving data at rapid rate is performance requirement.So, the statement given is false.

6 0
3 years ago
Someone hacked into an employees computer and erased all of their data. All data for the past three weeks was lost as that was w
ANEK [815]

Answer:

B. client server

Explanation:

Someone hacked into an employees computer and erased all of their data. The employee had last performed a backup three weeks back. This means that there is a backup server in the company. In other words, the network architecture is of the form client-server where data from the employee computers is backed up to a centralized repository from where content could be restored. Hence option B represents the most likely choice.

6 0
2 years ago
Read 2 more answers
Need help plz with the code
kvasek [131]

Answer:

its blocked

Explanation:

4 0
2 years ago
Other questions:
  • What is the other name of the horizontal column graph?
    6·2 answers
  • Which feature of Microsoft power point allowed you to put a picture in every slide
    8·1 answer
  • Why can't you test a program for run-time errors when it has compile-time (syntax) errors
    6·1 answer
  • Windows server 2008 supports three versions of certificate templates. what version or versions of templates can be issued only f
    13·1 answer
  • What is one benefit of using electronic sticky notes ?
    9·2 answers
  • Select the correct answer from each drop-down menu.
    7·2 answers
  • Consider the following schema for customer: (id, name, street, city, state, zip, phone), in which customers are uniquely determi
    10·1 answer
  • How can the use of new technology in industry benefit the us government
    8·2 answers
  • Who do you guys ship lol bit with?
    14·2 answers
  • Which network device sends data to every device that is connected to it?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!