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
natulia [17]
3 years ago
9

The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values on

ly.int foo = list[0];for (int j =1 ; j < list.length; j++)if (list[j] > foo)foo = list[j];Group of answer choicesit stores the largest value in list (the maximum) in fooit stores the smallest value in list (the minimum) in fooit stores every value in list, one at a time, in foo, until the loop terminatesit counts the number of elements in list that are greater than foo
Computers and Technology
1 answer:
worty [1.4K]3 years ago
5 0

Answer:

it stores the largest value in list (the maximum) in foo

Explanation:

Initially foo is assigned as the first element of the list

Inside the loop, every element in the list will be compared with foo, starting from the second element. If an element is greater than foo, the new value of the foo will be that element. At the end of the loop, foo will be equal to the largest element in the list.

You might be interested in
Write switch-case statement that displays the following information if the temperature is the input Activities at Lake LazyDays
Marta_Voda [28]

Answer:

//here is code in c++.

#include <bits/stdc++.h>

using namespace std;

int main()

{

// variable

int temp;

cout<<"Please enter the temperature:";

//read temperature from user

cin>>temp;

int n;

// reduce the case for switch

n=temp/10;

// print output according to the switch case

switch (n) {

case 7:

case 6:

cout<<"tennis"<<endl;

break;

case 5:

case 4:

cout<<"golf"<<endl;

break;

default:

if(temp>=80)

cout<<"swimming"<<endl;

else

cout<<"skiing"<<endl;

break;

}

return 0;

}

Explanation:

Read the value of temperature from user and assign it to variable "temp".

Calculate n=temp/10, to limit the number of cases in the switch statement.

if temperature is greater or equal 60 & less than 80, it will print "tennis".

If temperature is greater or equal 40 & less than 60, it will print "golf".

in default case, if temperature is greater than 80, it will print "swimming".

if less than 40, print "skiing".  

Output:

Please enter  the temperature::67                                                                                        

tennis

3 0
3 years ago
Which of the following keys moves the insertion point to the end of data in a cell?
IgorC [24]
C) End is the key that moves the insertion point to the end of data in a cell. 
5 0
3 years ago
In what stage of systems development are design specifications created?
timofeeve [1]

The stage of systems development in which design specifications (such as the architecture, the modules, the interfaces, and the data) are created is the stage of systems design. The purpose of systems design is primarily to satisfy the specified requirements.

5 0
3 years ago
Perform the Insert, Modify and Remove functionalities on the Dictionary based on the Key.
Ilia_Sergeevich [38]

Answer:

Dictionary contains Key value pairs where key is used to retrieve the value

Explanation:

Using System.Collections;

void main(){

Dictionary<int, string> dict = new Dictionary<int, string>();

dict.Add(1,"One");

dict.Add(2,"Two");

dict.Add(3,"Three");

dict.Remove(1);

dict[2] = "Two Updated";

}

Dictionary<int, string> is a dictionary whose keys are integers and values are strings.

Add function is used to add elements to the dictionary

Remove function removes the key value pair from the dictionary based on given key.

we can directly modify/update the element in dictionary using the key

7 0
3 years ago
Improvised Explosive Devices (IED) may be deployed in any shape, form, or size. Some of the types of IEDs are package-type IED,
m_a_m_a [10]

Answer:

Types of IEDs are<u> individual wearing explosive-type IED</u>, package-type IED and vehicle-borne IED.

Explanation:

Improvised Explosive Devices, commonly known as roadside bombs, are a type of explosives that are developed and used for purposes other than military action. IEDs can be deployed in any form, shape or size.

Improvised Explosive Devices can be of the following types:

1. Package-type IED

2. Vehicle-borne IED

3.<u> Individual wearing explosive-type IED</u>

6 0
3 years ago
Other questions:
  • There are two types of short-term memory: one type is involved in the input and storage of new information, the other type of sh
    9·1 answer
  • Write a program that asks the user to enter two dates (in YYYY-MM-DD format), and then prints which date is earlier. Your progra
    15·1 answer
  • Description A data retrieval tool that finds specified data within a database A collection of records All of the fields for a si
    7·1 answer
  • 2. An evil twin attack that broadcasts a legitimate SSID for an unauthorized network is an example of what category of threat? A
    9·1 answer
  • Which are examples of non-linear presentations? Choose all that apply.
    11·1 answer
  • 1.What is the term referring to an amount of money that is owed?
    6·2 answers
  • Calculate the cash available to retire debt for each of the six months. There is cash available to retire debt if there is a cas
    8·1 answer
  • PlZZZZZZZ help will give Brainliest
    8·2 answers
  • A fast way to add up a column of numbers is to click in the cell below the numbers and then: Click Subtotals on the Data menu. V
    6·2 answers
  • Which of the following expressions in Java is equal to 4?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!