Write a program that prompts the user for five 32-bit integers, stores them in an array calculates only the sum of the ODD values of the array, displays the sum on the screen. Ir addition, this program prompts the user for a 32-bit integer and display if the array contains this value or not. We suppose that we deal only with unsigned integer. Your code must be composed with the following procedures. 1. Main procedure 2. Prompt user for multiple integers 3. Calculate the sum of the ODD values of the array 4. Display the sum 5. Prompt user for an integer, fetch it into the array and display on screen "Exist" or "No Exist"

Answers

Answer 1

This program prompts the user for five 32-bit integers, stores them in an array, calculates the sum of the odd values in the array, and checks if a user-provided integer exists in the array.

Here's the program that prompts the user for five 32-bit integers, stores them in an array, calculates the sum of the odd values in the array, and checks if a user-provided integer exists in the array:

```cpp

#include <iostream>

const int ARRAY_SIZE = 5;

void promptUser(int array[]) {

   std::cout << "Enter " << ARRAY_SIZE << " integers: ";

   for (int i = 0; i < ARRAY_SIZE; i++) {

       std::cin >> array[i];

   }

}

int calculateOddSum(const int array[]) {

   int sum = 0;

   for (int i = 0; i < ARRAY_SIZE; i++) {

       if (array[i] % 2 != 0) {

           sum += array[i];

       }

   }

   return sum;

}

bool checkExistence(const int array[], int target) {

   for (int i = 0; i < ARRAY_SIZE; i++) {

       if (array[i] == target) {

           return true;

       }

   }

   return false;

}

int main() {

   int array[ARRAY_SIZE];

   

   promptUser(array);

   

   int sum = calculateOddSum(array);

   std::cout << "Sum of odd values: " << sum << std::endl;

   

   int target;

   std::cout << "Enter an integer to check: ";

   std::cin >> target;

   

   if (checkExistence(array, target)) {

       std::cout << "Exist" << std::endl;

   } else {

       std::cout << "No Exist" << std::endl;

   }

   

   return 0;

}

```

1. The `promptUser` procedure asks the user to enter five integers and stores them in the `array` using a loop and `std::cin`.

2. The `calculateOddSum` procedure iterates over the `array` and checks if each element is odd. If so, it adds the odd value to the `sum` variable.

3. The `checkExistence` procedure searches for the `target` integer in the `array` and returns `true` if it exists, and `false` otherwise.

4. In the `main` procedure, the user is prompted to enter the integers, and the `promptUser` procedure is called to populate the `array`.

5. The `calculateOddSum` procedure is called, and the sum of the odd values is stored in the `sum` variable, which is then displayed on the screen.

6. The user is prompted to enter an integer to check its existence in the `array`. The `checkExistence` procedure is called, and based on the result, "Exist" or "No Exist" is displayed on the screen.

This program assumes that the user will enter valid 32-bit unsigned integers.

To learn more about array  Click Here: brainly.com/question/13261246

#SPJ11


Related Questions

Linux is a type of software which we call ______.​

Answers

Answer: open source

Explanation:

Linux can be downloaded from the web, and it takes many different forms, so it is open source.

use humorous and monster in a sentence.

Answers

Answer: Here are a few...

1) The monstrous elephant trampled through the jungle crushing everything in its path.

2) Because it was so monstrous, the maid often got lost in the massive home she cleaned.

3) Monstrous amounts of foods are needed to feed the hundreds of refugees who showed up at the soup kitchen.

Explanation:

I hope this helps :D

Which of the following is not a strategy to help build empathy for your users?
O Explain the correct solution to your user

O Observe users and their behavior in the context of their lives

O Engage with and interview users

O Immerse yourself in the experience of your user

Which of the following is not a strategy to help build empathy for your users?O Explain the correct solution

Answers

Answer is a.) because empathy is the ability of understanding and sharing the feelings of another, if you’re just telling the user the solution, that’s not an empathetic strategy.

Explaining the correct solution to your user is not a strategy to help build empathy for your users.

What is empathy?Empathy is the function to understand or feel what another person is undergoing from within their frame of reference, that is, the function to place oneself in another's position. The term “empathy” is used to set out a large range of experiences. Emotion researchers generally define empathy as the capability to sense other people's emotions, coupled with the capability to imagine what someone else might be thinking or feeling.For example, you likely smile and take the trouble to remember people's names, and this is called empathy in action.

To learn more about empathy refer to:

https://brainly.com/question/15287960

#SPJ2

Which language gives instructions on how text should appear on a web page?
__Blank__ language gives instruction on how text should appear on a web page.

Answers

Answer:

HTML

HTML stands for HyperText Markup Language, so HTML gives you a way to “mark up” your text with tags that tell the browser how your text is structured.

Answer:

Markup language

Explanation:

Which category of elements is commonly used to make computer chips and solar cells due to their ability to conduct electricity only under certain conditions?.

Answers

The category of elements used to make computer chips and solar cells due to their ability to conduct electricity is metalloids

What are metalloids?

With no standard definitaion and concrete agreement on which element a metalloid is, metalloids are said to be a type of chemical which has a preponderance of properties in between, or that are a mixture of, those of metals and nonmetals.

Metalloids are widely used as alloys, biological agents, catalysts, glasses and optical storage media. Metalloids are also known to have applications in optoelectronics, semiconductors, pyrotechnics, and electronics etc.

Learn more on metalloids from:

https://brainly.com/question/6422662?referrer=searchResults

#SPJ4

what does it mean to present a document online?

Answers

advertising/advertisement

______________________ increases security by verifying identity based on more than just a password or pin.

Answers

Answer:

two-factor authentication

Explanation:

two-factor authentication increases security by verifying identity-based on more than just a password or pin.

media centralization refers to: question 5 options: the role of the computing cloud in making data and information increasingly accessible from remote locations the movement of the media production industry to california in the mid-twentieth century the fact that fewer and fewer groups own more and more of the media the fact that, as digital devices become more common, more people who can afford them are granted access to the media

Answers

Healthcare work practises were transformed by the digital revolution, which began with the Internet about 1980 and continued with mobile devices, social networking, big data, and computing clouds.

In addition to being able to access internet platforms and material, desktop computers, tablets, and laptops also have offline functionality. The usage of many other digital and electronic media devices, many of which are utilised offline, including televisions, CD players, and projectors, is also prevalent. Social media and mobile gadgets may cause psychological problems as well as physical problems including eyestrain and trouble focusing on crucial activities. Additionally, they could exacerbate more severe medical issues like depression. Children and teens who are still developing may be more negatively impacted by excessive usage of technology. 

To learn more about digital click the link below:

brainly.com/question/30142622

#SPJ4

What does CAD stand for?


Communicating Assisted Design

Counting All Dimensions

Computer Aided Design

Computer Assisted Development


helppp pless....!

Answers

Computer Aided Design is the correct answer

Answer:

C. Computer Aided Development

Explanation:

CAD stand for Computer Aided Development


I hope it helps! Have a great day!

Lilac~

¿Quién recibe la orden de ejecución de un programa enviada por el usuario?

Answers

Answer:

El sistema operativo.

Explanation:

En ciencias de la computación, una orden es una instrucción a un sistema operativo de computadora para realizar una tarea específica. Generalmente, una orden se emite a través de una interfaz de línea de órdenes de otro programa. Así, se trata de una instrucción a un programa de computadora para que actúe como intérprete para resolver un problema.  

Por ejemplo, podemos pedir a través de una orden que muestre el contenido de una carpeta, buscar un archivo en particular y especificar mediante parámetros adicionales cómo se debe realizar esta acción (por ejemplo, utilizando expresiones regulares para realizar una búsqueda).

Use recode to create a new variable name polview3. Collapse the three "liberal" codes into one category (coded 1 on polview3), put the "moderates" into their own category (coded 2 on polview3), and collapse the three "conservative" codes into one category (coded polview3). (Don't forget to recode missing values on polviews into missing values on polview3.) Using the label var command, give polview3 this label: "Ideology: 3 categories". Rub tab on polview3.

Write the series of codes to achieve this in stata.

Answers

To achieve the desired variable recoding in Stata, the following series of codes can be used. The codes involve creating a new variable, collapsing categories, recoding missing values, labeling the variable, and generating a frequency table using the tab command.

```

// Create a new variable named polview3

gen polview3 = .

// Collapse liberal codes into category 1

replace polview3 = 1 if previews >= 1 & previews <= 3

// Put moderates into category 2

replace polview3 = 2 if previews >= 4 & previews <= 6

// Collapse conservative codes into category 3

replace polview3 = 3 if previews >= 7 & previews <= 9

// Recode missing values

recode previews (. = .) (else = .), generate(polview3)

// Label the variable

label var polview3 "Ideology: 3 categories"

// Generate frequency table

tab polview3

```

These codes first create a new variable named polview3 and assign missing values to it. Then, the liberal, moderate, and conservative codes are collapsed into three categories using the replace command. Missing values are recoded to missing values on the polview3 variable. The label var command assigns the label "Ideology: 3 categories" to the polview3 variable. Finally, the tab command generates a frequency table for the polview3 variable.

Learn more about variable recording here:

https://brainly.com/question/33659851

#SPJ11

solve the following equations and check your result 1) 3x=2x+18​

Answers

Answer:

x = 18

Explanation:

3x = 2x+18

3x-2x = 18

x=18

Answer:

Explanation:

3X-2X=2X-2X+18

X=18

Column Command is present in Home Tab. (1 Point) True False

Answers

Answer:

True

Explanation: Column Command is always present in Home Tab

PLEASE HELP!! WILL MARK BRAINLEST
What positive and negative impact does Instagram have on you?

Answers

Instagram has many and negative impacts depending on what users are interacting and what posts are made.

Negative:

Toxic peopleDiscouraging commentsRude judgementNeed for popularity

Positive:

A way to shareCommunication between friendsEncouraging commentsSomewhere to find inspiration

There's many more things, but I just listed a few that I can remember.

What does it mean when someone endorses you on linkedin.

Answers

Answer:

LinkedIn endorsements are a way for the people in your network to confirm your aptitude and experience within your professional field. Every endorsement you get on the skills listed on your LinkedIn profile helps you to be more easily found and, just maybe, to land the job you've always wanted.

Explanation:

Which of the following is most likely to occur if a special effects artist holds up production on a feature film because he is not satisfied with the “look” of the work?

A. The artist will be offered future contracts.
B. The artist will not be offered future contracts.
C. The artist will earn the respect of his colleagues.
D. The artist will be fired.

Answers

It definitely B I say because what if he made the film worse than it is.

If involved in a boating accident causing serious bodily injury or death while boating under the influence, the operator has committed a _____. felony misdemeanor non-criminal offense liability

Answers

Answer:

felony

Explanation:

It is an offence on the part of a boat operator who is under the control of alcohol while boating, as such could result in property damage, serious bodily injury or death. Where such leads to bodily injury or deaths, the operator could be convicted for felony while misdemeanor applies to property damage.

There have been a reoccurring boating incidence in the country especially in the state of Florida, which has the highest number of boating fatalities hence created stiff penalties for boating under the influence of alcohol.

While it is adviseable for motorists not to drink and drive, it is also not lawful be under the influence when boating as such could cause injury, deaths or property damage and such operator would receive appropriate penalty depending on the outcome of the incident.

what is the difference between coding with html and coding with python

Answers

Answer:

Python is an object-oriented programming language that is designed to be accessible and simple for all users, HTML is a web language and is used globally to define the structure of web pages by using various tags. HTML is not a programming language it's a markup language which is used to formatting web pages. Python is a general purpose scripting language which can be used to develop a wide range of programs.

how to accept shared album on iphone

Answers

Subscribe to a shared album
When you receive an invitation, tap the iCloud notification, then tap Accept. You can also accept an invitation in an email.

write the definition of a function power to, which receives two parameters. the first is a double and the second is an int. the function returns a double. if the second parameter is negative, the function returns zero. otherwise it returns the value of the first parameter raised to the power of the second.

Answers

The definition of a function power_to, which receives two parameters is:

def power_to(bdouble, bint):

if bint<0:

return 0

else:

return bdouble**bint

What are parameters?
A parameter is a unique type of variable that is used in a function to refer to one of the bits of data given to the function as input. These data points represent the values of the arguments used to call or invoke the function.

A function's definition often includes an ordered list of parameters so that the function's arguments are evaluated each time it is called and the resulting values can be assigned to the associated parameters.

To learn more about parameters, use the link given
https://brainly.com/question/29555936
#SPJ4

You can only create one document from a template true or false

Answers

Answer:

good to kow

Explanation:

False you can make more than one

Taking an entire work by someone else and passing it off as your own is called
copyright
global plagiarism
plagiarism
unethical

Answers

Taking an entire work by someone else and passing it off as your own is called: C. plagiarism.

What is plagiarism?

Plagiarism can be defined as the act of representing or using an author's literary work, thoughts, ideas, language, or expressions without their consent, permission, acknowledgement or authorization.

This ultimately implies that, plagiarism is an illegal act that involves using another author's intellectual work or copyrighted items word for word without getting an authorization or permission from the original author.

In this context, we can reasonably infer and logically deduce that plagiarism is an act of taking another person's entire work passing it off as yours.

Read more on plagiarism here: brainly.com/question/397668

#SPJ1

Write a function that tests the equal of the mean
of two normal distributions while the variances are known, using
the Monte Carlo technique.

Answers

The implementation of a function that tests the equality of the means of two normal distributions using the Monte Carlo technique, assuming known variances:

The Function

import numpy as np

def monte_carlo_mean_equality_test(sample1, sample2, variance1, variance2, alpha, num_iterations):

   mean_diff = np.mean(sample1) - np.mean(sample2)

   pooled_std = np.sqrt(variance1/len(sample1) + variance2/len(sample2))

   z_scores = np.random.normal(loc=0, scale=pooled_std, size=num_iterations)

   p_value = (np.abs(z_scores) >= np.abs(mean_diff)).mean()

   return p_value > alpha

This function takes sample1 and sample2 as the samples from the two normal distributions, variance1 and variance2 as their respective variances, alpha as the significance level, and num_iterations as the number of Monte Carlo iterations to perform.

It returns a boolean indicating whether the null hypothesis (equal means) can be rejected or not.


Read more about boolean here:

https://brainly.com/question/30703987
#SPJ4

Check the devices that are external peripheral devices:

Check the devices that are external peripheral devices:

Answers

Answer:

Mouse, and keyboard

Explanation:

Common Sense

A Linux systems admin reported a suspicious .py file that ran on a daily schedule after business hours. The file includes shellcode that would automate Application Programming Interface (API) calls to a web application to get information. What type of script is executing this shellcode

Answers

Answer: Python script

Explanation:

Based on the information given in the question, the type of script that is executing this shellcode is the Python script.

The Python script is a file that contains codes that are written in Python. In such case, the file which contains the python script typically has an extension

which is ".py"' or ".pyw" when it's run on windows

Therefore, based on the information given, the answer is Python script.

The type of script used in executing the shellcode that would automate Application Programming Interface (API) calls to a web application to get information is called; Python Script.

The type of script required to execute the given shellcode is called a python script. This is because the Python script is simply defined as a file that contains a code which is written in Python.

Now, this file which contains the python script will have the extension ‘.py’. However, if it is being run on a windows machine, it could also be the extension ‘.pyw’.

Finally, to run a python script, all we need to do is to get a python interpreter that we will download and install.

Read more about python at; https://brainly.com/question/16397886

You have just plugged a USB hard drive into an older laptop and the disk has not appeared as available. You are concerned that the hard disk hardware has not been recognized by the computer. What utility would you use to verify??

Answers

Answer:

Device Manager and Disk Management

Explanation:

There are two main utilities that can be used to solve this problem. The main one being device manager. This utility will show you any and all devices connected to the computer. This includes USB hard drives. If it is detected and has a driver installed it will show up in Device Manager. From here you can also change the drivers, disable/enable it, etc. If the device is not listed in Device Manager then you can use the Disk Management utility to check if it is listed there. This can sometimes happen when the disk does not have a proper drive letter, which can be adjusted in Disk Management. Both of these utilities are built-in to windows operating systems.

why computer is a reliable machine?

Answers

Answer:

Computer is a reliable machine because it gives consistent result for similar set of data

Answer:

Each computer generation has improved the reliability over the preceding generation, as have other electronic devices produced in the same time period.

A computer is a reliable machine.

Modern electronic components have failure free long lives.

Computers are designed to make maintenance easy.

Hope you got it

If you have any question just ask me

If you think this is the best answer pease mark me as brainliest

Can you please help me? I give you a brainlest
! ​

Can you please help me? I give you a brainlest !

Answers

1.
2.satin stitch
3.lazy daisy stitch (detached chain )
4.chain stitch
5. cross stitch
6. french knot
7.
8.split stitch
9.
10. back stitch
the others i can’t tell.

To use the shortcut for inserting a row,_____
on the row number and choose Insert.
Right-click
Double-click
Shift-click
Click

Answers

I think it is double click

Project: Math Tutor Program with Error Handling
image of a man sitting on a branch he is about to cut off

Sawing off the branch you are sitting on can only end badly (Imagery supplied by photoschmidt/iStock via Getty)
Unlike the man in the picture, you already know how to plan for and handle errors before they happen. You know how to create and use lists. You know how to use loops. You are going to put these abilities to work in this project. You are going to write a program to help young children with their arithmetic skills.

Objectives
Plan and create a program to practice math facts with error handling.

Your Goal
Your users are young children learning their arithmetic facts. The program will give them a choice of practicing adding or multiplying.

You will use two lists of numbers.

numA = [4, 1, 6, 10, 2, 3, 7, 9, 11, 12, 5, 8]

numB = [2, 12, 10, 11, 1, 3, 7, 9, 4, 8, 5, 6]

If the user chooses adding, you will ask them to add the first number from each list. Tell them if they are right or wrong. If they are wrong, tell them the correct answer.
Then ask them to add the second number in each list and so on.

If the user chooses multiplying, then do similar steps but with multiplying.

Whichever operation the user chooses, they will answer 12 questions.

Write your program and test it on a sibling, friend, or fellow student.

Errors
Think about the types of errors a user can make. Add at least one kind of error handling to your program.

What to Submit
Save your program with a .txt extension. You cannot upload a .py file.
Before you turn your project in, read the rubric.

I need this to be original work

Answers

Answer:

finished = False

numA = [4, 1, 6, 10, 2, 3, 7, 9, 11, 12, 5, 8]

numB = [2, 12, 10, 11, 1, 3, 7, 9, 4, 8, 5, 6]

while True:

 pick = input("Would you like to practice addition (+) or multiplication (*)?")  

 

 if pick == "+":

   for o, k in zip(numA, numB):

     ans = input(f"What is {o} + {k}?")

     

     if ans == str(o + k):

       print('Correct!\n')

     else:

       print(f"Incorrect! The correct answer was {o + k}\n")

   finished = True

 

 elif pick == "*":

   for o, k in zip(numA, numB):

     ans = input(f"What is {o} * {k}?")

     

     if ans == str(o * k):

       print('Correct!\n')

     else:

       print(f"Incorrect! The correct answer was {o * k}\n")

   finished = True

 

 else:

   print('Incorrect Input!')

 

 if finished:

   print('Thanks for playing!')

   break

Explanation:

aduhhhh

Other Questions
A six-pointed star was wanted by General Washington.OActivePassive Identify the range of the graphed function The ratio of the areas of similar polygons is 64: 16. What is the ratio of their sides Q4. Consider a time series {Y} with a deterministic linear trend, i.e.Yt=ao+at+t,Here {} is a zero-mean stationary process with an autocovariance function x (h). Consider the difference operator such that Y = Yt - Yt-1. You will demonstrate in this exercise that it is possible to transform a non-stationary process into a stationary process.(a) Illustrate {Y} is non-stationary.(b) Demonstrate {W} is stationary, if W = Yt = Yt - Yt-1. need help with 12 and 13 Reinforcement covers dictated by structural drawings are minimums and can be increased at the contractor's options without detrimental effects?T/F The Lemon Experiment is a breathing technique.A) TrueB) False Expand and simplify 2(5x+4)+ 3(2x-1) ebooks are not interactive and only work during the semester the couse is offers.True or false Determine whether each statement about the trapezoid is true. Choose true or false from each drop-down menu for each statement Figure ABCD is a rhombus.Rhombus A B C D is shown. Angle A is (5 x + 25) degrees and angle D is (7 x minus 1) degrees.What is the value of x?13142628 the cost to retail percentage is found by dividing goods available for sale at blank by goods available for sale at blank . multiple choice question. cost; market value current selling price; cost retail; cost cost; current selling price Round 156.789 to nearest One?Tenth? Hundredth? Why was aunt jemima chained to a table? give me the truth. which are stages of cognitive development of infants according to piaget? select all that apply. one, some, or all responses may be correct. 1.) The stage in mitosis in which chromosomes replicate themselves. A. AnaphaseB. MetaphaseC. ProphaseD. Telophase2.) The stage in mitosis that results in two new daughter cells being formed. A. Anaphase B. Metaphase C. Prophase D. Telophase3.) The chromosomes like up in the middle of the cell during this stage. A. Anaphase B. Metaphase C. Prophase D. Telophase4.) The process where a pair of chromosomes pair up and exchange genetic material. A. Crossing over B. Gamete cellsC. Replication D. Reproduction 5.) In Meiosis II the cell division begins with how many daughter cells? A. One B. TwoC. ThreeD. Four 6.) Which is NOT true of Meiosis? A. Meiosis starts with half the number of chromosomes as Mitosis. B. The genetic offspring are exactly like the parent cell. C. There are 23 chromosomes from each parent cell.D. Meiosis goes through 2 stages of division, Meiosis I and II. why are locations such as south America, Africa, and Austrlia so much smaller than locations such as U.S and china? And electrician is running wire from the electric box on a house to a utility pole 75 feet away. The angle of elevation to the connection on the pool is 16 degrees. How much wire does the electrician need? how come if you jump in a train you will land in the same spot but if you jump on top of the train you won't? i tried to make it make sense. A certain triathlon consists of a 3.1-mile swim, a 120-mile bicycle ride, and a 26.6-mile run. At one point, a participant had completed four times as many miles as thenumber of miles left to complete. How many miles had he completed at that mark?