Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint: use Mod). Displays the sum.

Answers

Answer 1

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main()//defining main method

{

int x[]={2,3,4,6,7,8,9,1,11,12};//defining 1-D array and assign value

int i,sum=0;//defining integer variable

for(i=0;i<10;i++)//defining loop for count value

{

   if(x[i]%2==1)//defining if block to check odd value

   {

       sum=sum+x[i];//add value in sum variable

   }

}

cout<<sum;//print sum

return 0;

}

Output:

31

Explanation:

In the above-given program, an integer array "x" is declared that holds some integer values, and in the next line two integer variable "i and sum" is defined which is used to calculate the value.

In the next line, a for loop is declared, that counts all array value, and it uses the if block to check the odd value and add all the value into the sum variable.

Answer 2

The code is in Java.

It uses for loop, if-else structure, and mod to calculate the sum of odd numbers in a list.

Comments are used to explain each line of code.

You may see the output in the attachment.

//Main.java

import java.util.*;

public class Main

{

public static void main(String[] args) {

   

    //create a list with some numbers

    List<Integer> lotsOfNumbers = Arrays.asList(7, 20, 1002, 55, 406, 99);

   

    //initialize the sum as 0

    int sumOfOdds = 0;

   

    //create a for each loop to iterate over the lotsOfNumbers list

    //check each number, if it is odd or not using the mod

    //if it is odd, add the number to the sum (cumulative sum)

    for (int number : lotsOfNumbers){

        if(number % 2 == 1)

            sumOfOdds += number;

    }

   

    //print the sum

    System.out.println("The sum of odd numbers: " + sumOfOdds);

}

}

You may check out another question at:

https://brainly.com/question/24914609

Write A Program That: Takes The List LotsOfNumbers And Uses A Loop To Find The Sum Of All Of The Odd

Related Questions

Help, please! I will mark as brainliest

Answers

Answer:

Change line 7 to:

for( int i=0; i < names.length; i++)

Last element in the array is one less than the length, ie:

stArr1.length - 1

To print every other value, you replace index++ with index += 2

Explanation:

Not only should you change the <= into <, but also i should start at 0, not 1. The first element of an array has index 0.

Can someone please tell, me whats wrong with this code....its supposed to give the fibonacci sequence as output but its giving 0 as output instead​

Answers

def series(n):

   n1 = 0

   n2 = 1

   count = 0

   if n <=0:

       print("Please enter a positive integer")

   if count ==0:

       print(0)

       print(1)

       count +=2

   while count < n:

       nth = n1 + n2

       n1 = n2

       n2 = nth

       count += 1

       print(nth)

series(7)

I've written the working code. You added a break statement which right under a print function, which only printed the value of n1 and by looking at your variables, n1 = 0. That's why it was only printing 0.

Which group of Indians was native to Roanoke and not very friendly?
Croatan
Cherokee
Iroquois
Plain Indians

Answers

Answer:

Croatan I think if I remember it right.

Explanation:

Yep it’s Croatan. Hope this helps.

Mathematics and computer science share the concept of recursion.
You wrote a program to find the factorial of a number using recursion.
5! =

Answers

5! is equal to 120.

5 * 4 * 3 * 2 * 1 = 120

Answer: 5

Explanation: got it right on edgen

If you need to modify a features in a part created using the Mirror tool, you can make the change in the original feature and the feature on the other side of the mirror plane will be modified automatically.
Select Answer

False

True

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is TRUE.

Because when you are designing something and drawing anything and it is symmetric in shape and half of the part is created, then if you use mirror features, then the other half part will get created automatically.

If you need to modify the features in the original part of the drawing or design then the other side of the mirror plane will be modified automatically.

Because whatever you will make changes in the original part of the design, then the other part that is created by using mirror features will get modified automatically.  

Lionel is a director working on a children's video. He's finding it difficult to manage so many young actors. What should Lionel do to free himself for other creative work?

Answers

Answer:

Explanation:

There are two things that Lionel can do in order to free himself. One of which would be to create a program that automates the management process of the young actors, such as scheduling them, payments, rehearsals, etc. Anything that Lionel would have to spend time on to do that does not require face to face communication can be automated, thus saving him time. The second thing that Lionel can do is to limit his workday with the children, therefore leaving more time in the day to pursue other creative work.

A draft has the following:
Plot
Details
Transition Words
Important events in order

Answers

What do you have to do?

dash is a set of communication standard using for transferring file information between computers in a network​

Answers

Answer:

protocol

Explanation:

hope this helps.

Use the table and the drop-down menus to order the
steps.
Click on the New tab.
Click on the Save or Save As tab.ha
Click on the Blank workbook image.
Type data into the columns and rows.
Create file name and choose location of file.

Answers

Answer: 2, 6, 3, 4, 7

Explanation:

Answer:

2

6

3

4

7

Explanation:

if a friend asked you to help her decide what internal sabling system to install in her new house, what kinds of questions wouls you ask her to do? why would you ask those questions?​

Answers

Answer:

Assuming you mean *cabling system*

you could ask:

- The architectural structure of the building, which houses for the cabling installation.

- The function of the cabling installation.

- The configuration of an already installed system (upgrades and retrofits).

others

- The cable and connection products.

- The types of equipment the cabling installation will support -- present and future.

- Customer requirement.

Which operating system function has a steeper learning curve and can potentially break the system without careful use of its operations?

1. Graphical user interface (GUI)
2. Service management
3. Application management
4. Command line interface (CLI)

Answers

Answer:

4. Command line interface (CLI)

Explanation:

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

Some examples of an operating system on computers are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

A Command line interface (CLI) refers to a text-based user interface that allow users to operate a software application or program, as well as manage and execute operating system functions by typing standard line of commands into the text-based user interface with a real-time response.

Basically, the CLI is solely text-based and as such requires a thorough knowledge and understanding of global commands, as well as administrative privileges in some cases.

Hence, the operating system function which has a steeper learning curve (more difficult to learn) and can potentially break the system without careful use of its operations is the Command line interface (CLI).

Identify the tasks that people can perform using a web browser. View a web page Program a computer Record a video Organize the entire hard drive Shop from a web page Download an MP3 file Upload photographs to an Internet site Search for a web page

Answers

Answer:

1,3,5,6,7,8 on edge2020

Explanation:

Answer: 1, 3, 5, 6, 7, 8

Explanation: got a 100

Which statement describes a biotic factor interacting with the environment?

Water flows down a creek bed.
Soil contains nutrients for growth.
Deer graze through the grassland.
The sun emits solar rays that reach Earth.

Answers

Answer:

Deer graze through the grassland.

Explanation:

Biotic factors are living components of the environment that shapes the ecosystem. Abiotic factors are the non-living component of the environment.

These biotic factors are plants, animals and micro-organisms.

A deer grazing through the grassland is a a biotic factor interacting the environment. The other choices contains abiotic factors.

Abiotic factors are soil, sunlight, nutrients etc.

Answer:

C

Explanation:

How would I copy this image?

There is an image from a scientific research pdf that I would like to use for one of my research papers in school, but I am unable to find out how to copy it and then paste it into my paper.

Thank you for your hep

Answers

Question: How would I copy this image?

Answer: Either screenshot it, or CTRL C ± CTRL V it. To screenshot something, open 'snipping tool' and pull up the PDF, then box in whatever you are trying to copy. You can also reverse image search it to find it somewhere on the web.

Uplifting Note: To you, smiling at someone may mean nothing, but to them, it might be their whole world.

What is the value of the variable? (1 point)
double dNum =
(int) 38.78;

1) 38
2) 38.0
3) 38.78
4) 39
5) Error: incompatible types

Answers

2) 38.0

it’s converted into int in then back to double

How do you skip the drawing steps in turtle graphics and just get the result? Thank you.

Answers

Answer:

Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. Give it the command turtle.forward(15), and it moves (on-screen!) 15 pixels in the direction it is facing, drawing a line as it moves. Give it the command turtle.left(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and pictures can easily be drawn.

The turtle module is an extended reimplementation of the same-named module from the Python standard distribution up to version Python 2.5.

It tries to keep the merits of the old turtle module and to be (nearly) 100% compatible with it. This means in the first place to enable the learning programmer to use all the commands, classes and methods interactively when using the module from within IDLE run with the -n switch.

The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support.

The object-oriented interface uses essentially two+two classes:

The TurtleScreen class defines graphics windows as a playground for the drawing turtles. Its constructor needs a tkinter.Canvas or a ScrolledCanvas as argument. It should be used when turtle is used as part of some application.

The function Screen() returns a singleton object of a TurtleScreen subclass. This function should be used when turtle is used as a standalone tool for doing graphics. As a singleton object, inheriting from its class is not possible.

All methods of TurtleScreen/Screen also exist as functions, i.e. as part of the procedure-oriented interface.

RawTurtle (alias: RawPen) defines Turtle objects which draw on a TurtleScreen. Its constructor needs a Canvas, ScrolledCanvas or TurtleScreen as argument, so the RawTurtle objects know where to draw.

Derived from RawTurtle is the subclass Turtle (alias: Pen), which draws on “the” Screen instance which is automatically created, if not already present.

All methods of RawTurtle/Turtle also exist as functions, i.e. part of the procedure-oriented interface.

The procedural interface provides functions which are derived from the methods of the classes Screen and Turtle. They have the same names as the corresponding methods. A screen object is automatically created whenever a function derived from a Screen method is called. An (unnamed) turtle object is automatically created whenever any of the functions derived from a Turtle method is called.

To use multiple turtles on a screen one has to use the object-oriented interface.

Note In the following documentation the argument list for functions is given. Methods, of course, have the additional first argument self which is omitted here.

Explanation:

can i have brainliest

Data is a processed in the form of information? ( true or false)​

Answers

Answer:

True ( processed data is called information)

What additional uses of technology can you see in the workplace? List ways technology impacts
other careers not discussed in this module, such as finance, government, non-profits, and
agriculture.

Answers

People can be making the technology, technology can be used to help solve problems and help further educate people with what they are working on. Technology impacts agriculture because their are certain technology to help farmers farm fast and help water the land without needing a human to do it. Technology can help finance by helping people add and subtract rather than doing in their hand.

Can someone find out what this binary number thing is. Just find out the message, I'm having a difficult time

Answers

Answer:

Press alt and F4 to see answer

Explanation:

Categorive the given websites based on their possible website structure
company website
bookstore website
computer-based
training modules
single product website
city library website
online in store website
Hierarchical
Sequential
Matrix
Hi

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

There are different website structures such as hierarchical, sequential, and matrix. These websites structure helps the designers to create a meaningful website.

In this question, it is asked to categories the given website into their website structure.

The given websites are:

company website bookstore website computer-based  training modules  single product website city library website online in-store website

Now, we will categorize these websites into their website structure:

Hierarchical website structure:

Bookstore website

city library website

online in-store website

Sequential website structure:

single product website

computer-based training module

Matrix website structure:

Company website.

Here are the categorizations of the given items based on their storyboarding techniques:

Computer-based training modules: Linear

School website: Webbed

Bookstore website: Webbed

Single-product website: Linear

County library website: Webbed

Online gift store website: Linear

Federal government website: Hierarchical

Martha is typing on her computer. What type of communication is this? A. human-to-human B. human-to-machine C. machine-to-human D. machine-to-machine

Answers

Answer:

Human-to-machine

Explanation:

It is a human typing into a machine.

I hope this helped <3

identify the final stage of the object found in the image in the given text

Answers

Answer:

science fiction book

Explanation:

What is a good way to become a game developer without spending a lot of money?

Answers

Answer:

Codes

Explanation:

learn the codes first. when you're already expert, you'll find ways from there.

This is using python.
Assuming all the variables are non-zero.

Which lines of code will assign the discriminant the value b2−4ac? Select 2 options.


discriminant = bb - 4ac

discriminant = b * b - 4 * a * c

discriminant = b ^ 2 - 4ac

discriminant = b ** 2 - 4 * a * c

discriminant = b ^ 2 - 4 * a * c

Answers

Answer:

discriminant = b * b - 4 * a * c

discriminant = b ** 2 - 4 * a * c

Explanation:

The operands are correct and in the right order (for python).

** is the operand for squaring something.

* is the operand for multiplying something.

- is the operand for subtracting something.

Let's take a look at these examples individually.

discriminant = bb - 4ac. You have to use the * sign so the computer understands that you're trying to multiply two objects together.

discriminant = b * b - 4 * a * c. This example works because it's using the * where it's appropriate.

discriminant = b ^ 2 - 4ac. In python we don't use the ^ sign. To use exponents, we use **. Also, there is no * sign in between 4, a, and c.

discriminant =  b ** 2 - 4 * a * c. This example works because it uses the ** and * sign where appropriate.

discriminant = b ^ 2 - 4 * a * c. This example uses the ^ sign and python does not support it.

what is displayed as a result of executing the following code segment?


x < - - 2
y < - - X * 4
z < - - X * Y
x < - - X + Y
z < - - z + ( x - y) * 3
DISPLAY ( x + y + z)

select one answer
A - 72
B - 40
C - 8
D - 54​

Answers

The first one I’m not sure it’s quite complicated

The position of a runner in a race is a type of analog data. The runner’s position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally?
A
The position of the runner is determined by calculating the time difference between the start and the end of the race and making an estimation based on the runner’s average speed.
B
The position of the runner is measured and rounded to either 0 or 1 depending on whether the runner is closer to the starting line or closer to the finish line.
C
The position of the runner is predicted using a model based on performance data captured from previous races.
D
The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

Answers

Answer:

D. The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

Explanation:

C was wrong for me :(

Introduction:

The runner position is detected by sensors in a race. It is very difficult to keep track of every racer position manually therefore computer program are used to keep exact recordings.

Explanation:

The data is sometimes recorded manually and is in analog form which is converted in to digital form.

Conclusion:

The correct answer is D. The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

Learn more at https://brainly.com/question/24577222

Calculate and express your answer in decimal form.

12⋅17
34⋅200
(0.2)⋅40
(0.25)⋅60

Answers

Answer:

ポイントが欲しいだけなのかわからない

Explanation:

何語を話していますか

Coding question. Please help me?

Answers

Answer:

a  for a loop

Explanation:

The left and right margins of the page should always be the same.

True
False

Answers

Answer:true

Explanation:

In the context of website navigation, what is a node?

Answers

Answer:

a point at which the user chooses a certain path.

Other Questions
what is the slope of the line ? please Some germs rely on insect carriers such as mosquitoes, fleas, lice or ticks to move from host to host. These carriers are known asvectorsvirusbacteriumO meningitis HELP WILL GIVE BRAINLIEST In the following conjugation of the verb, write if it is correct-incorrect.I goYou goes he go she goes we go you go They go. There are 20 students. Two-fifths of the students are girls. How many students are girls? which of the following was the original purpose of the bill of rightsA to give the people their natural rightsB to restrict the power of the national gavernment C to restrict the power of state governmentsD to list civil rights that would apply to all people give three arguments in the favour of Universal adult franchise Which constitutional principle is applied when police inform suspects of their rights? A due process of law b double jeopardy c eminent domain d trial by jury Analyze the map below and answer the question that follows.A map of Asia with Southeast Asian countries highlighted. Two bodies of water are labeled A and B. A is near India between Africa and Malaysia and Singapore. B is east of Taiwan, the Philippines, and Japan.Image by VervictorioThe letters A and B mark two bodies of water that surround Southeast Asia, the __________.A.Mediterranean and Red SeasB.Atlantic and Arctic OceansC.Indian and Pacific OceansD.Bering and White SeasPlease select the best answer from the choices providedABCD A satellite travels 12 miles in 15 minutes at a constant speed. What is the satellites speed in mile per hour? answer the question for good boy stars why has china been one of the longest continuous civilizations? The holiday of Kwanzaa:A. Rejects Christianity.B. Is based on the Nation of Islam.C. Celebrates African traditions.D. Encourages Africans to come to the United States. _________________ were Europeans born in Latin America and their descendants. Several __________________ groups were beneath the __________________ and the peninsulares.plz help PLS Help!!!! 100 Points!!!What group of people is being criticized by this cartoon? Northerners who moved to the South after the Civil War plantation owners who left the South after the Confederacy was defeated African American politicians who served in Congress during Reconstruction Southern Democrats who opposed efforts to protect African Americans' civil rights What instrument does Kate Keller want Sue Bayliss to take up?A. ViolinB. TubaC. PianoD. Guitar What is the value of the expression 5y + 4x when x = 2.5 and y = 3? What was the main argument of public school reform activists in the early nineteenth century? Before the 1500s people gained their understanding about the natural world from? IM GIVING BRAINLIEST ( ) I'm having trouble pronouncing this Love/romance is what it means