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
arlik [135]
3 years ago
9

Given the following code. float dollars[5] = {1986.10, 240.99, 215.50, 75.00, float euros[5]; Give the C++ code that will fill t

he euros array with the corresponding euro value dollars array. So the first element of euros will be equivalent to the euro vat clement of the dollars array, etc. Use the following formula: 1 dollar = .92 euro
Computers and Technology
1 answer:
Oksana_A [137]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main()

{

  float dollars[5] = {1986.10, 240.99, 215.50, 75.00, 65.97};

  float euros[5];

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

      euros[i] = dollars[i]*0.92;

  }

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

      cout<<euros[i]<<endl;

  }

  return 0;

}

Explanation:

First include the library iostream for input/output.

then, create the main function and declare the arrays.

after that, take a for loop for traversing through dollars array and convert into euros by multiply each element with 0.92 value and store in the euros array with same index value as dollars array.

finally, take the for loop for print each element of the euros array.    

You might be interested in
How do I persuade my parents to allow me to have social media? I will be 15 in a week or so, so I am old enough. I'm pulling my
Flauer [41]

Answer:

my explanation is above my comment :)

Explanation:

6 0
3 years ago
What is a characteristic ofa good cloud-based hosting?
Aliun [14]

Answer:

Explanation:

A good cloud-based hosting has many beneficial characteristics, some of which include on-demand self-service, broad network access, and being very elastic and scalable. These characteristics allow for a large number of users to benefit from the service at any time of the day and at a very fast speed due to the broad network access.

6 0
3 years ago
What set of code correctly initializes all elements of the array ar to the value 0, given the declaration
Veronika [31]

Answer:

The correct answer is:

C. ndx = 0;

while (ndx < 3) {

ar[ndx] = 0;

ndx++;

}

Explanation:

The declaration given is:

int ar[3];

This means the array consists of three locations and is named as ar.

We know that the indexes are used to address the locations of an array and the index starts from 0 and goes upto to 1 less than the size of the array which means the indexes of array of 3 elements will start from 0 and end at 2.

Now in the given options we are using ndx variable to run the while loop.

So the code to assign zero to all elements of array will be

ndx = 0;

while(ndx<3)

{

ar[ndx] = 0;

ndx++;

}

Hence, the correct answer is:

C. ndx = 0;

while (ndx < 3) {

ar[ndx] = 0;

ndx++;

}

7 0
3 years ago
TRUE/FALSE QUESTIONS: T F 1. An intruder can also be referred to as a hacker or cracker. T F 2. Activists are either individuals
Law Incorporation [45]

Answer:

1. True 2. False 3. True 4. True 5. True 6. False 7. True

Explanation:

1.  A hacker/cracker finds and exploits weakness in order to gain access with a criminal intent, just as an intruder.

2. Activists are people who campaign to bring about a positive political or social change.

3. It is illegal to use a device as a packet sniffer to steal people's usernames and passwords.

4. This quite true, as there is a huge community of hackers where people are highly recognized for hacking.

5. Yes, intruders have a common attack methodology.

6. IDS monitors networks or systems to identify suspicious activities while a user interface is the means the computer and the user interacts. So it's false.

7. instrusion detection involves monitoring networks or systems to identify suspicious activities, so an intruder is detected if their behavior is suspicious when compared to a legitimate user.

5 0
3 years ago
Write a multi-threaded program that outputs prime numbers. The program should work as follows: the user will run the program and
Ierofanga [76]

Answer:

The programming code can be found in the explanation part, please go through it.

Explanation:

Code:

#include<stdio.h>

#include<stdlib.h>

#include <pthread.h>

// function check whether a number

// is prime or not

int isPrime(int n)

{

// Corner case

if (n <= 1)

return 0;

// Check from 2 to n-1

for (int i = 2; i < n; i++)

if (n % i == 0)

return 0;

return 1;

}

void* printPrimes(void *vargp)

{

int *n = (int *)vargp;

int i=0;

for (i=2;i<=n;i++)

{

if (isPrime(i)) printf("%d\n", i);

}

}

// Driver Program

int main(int argc, char* argv[])

{

int n = atoi(argv[1]);

pthread_t tid;

pthread_create(&tid, NULL, printPrimes, (void *)n);

pthread_exit(NULL);

return 0;

}

4 0
3 years ago
Other questions:
  • What is the importance of using the proper markup language?
    8·2 answers
  • The HR department of a company wants to send out an email informing its employees about an upcoming social event. Which email ap
    11·2 answers
  • How do you add text to a blank slide layout?
    5·2 answers
  • The ____ command creates a subdirectory under a directory. rd md cd ad
    11·1 answer
  • Which of the following actions can NEGATIVELY impact your credit score?
    9·1 answer
  • 1. Build and test D-type Flip-Flop using a built-in SR flip-flop.
    12·1 answer
  • What is human data,
    8·1 answer
  • Even if you cannot afford it you should donate at least 5 of your earnings to charity true or false
    8·1 answer
  • (Print distinct numbers) Write a program that reads in integers separated by a space in one line and displays distinct numbers i
    8·1 answer
  • Unit 2: Lesson 6 - Coding Activity 1
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!