If the vector oldData is the same as the vector newData, print "Data matches!" ended with a newline. Otherwise, assign oldData with newData. Ex: If oldData = {10, 12, 18} and newData = {25, 27, 29, 23}, then oldData becomes {25, 27, 29, 23}.
Only enter the Solution Part
#include
#include
using namespace std;
int main() {
vector oldData(3);
vector newData(4);
unsigned int i = 0;
oldData.at(0) = 10;
oldData.at(1) = 12;
oldData.at(2) = 18;
newData.at(0) = 25;
newData.at(1) = 27;
newData.at(2) = 29;
newData.at(3) = 23;
// Enter Solution here
for (i = 0; i < oldData.size(); ++i) {
cout << oldData.at(i) << " ";
}
cout << endl;
return 0;
}

Answers

Answer 1

Answer:

Following are the solution part to this question:

for(i=0;i< oldData.size()&&i< newData.size();i++) //defefing loop to assign newData value to oldData value              

    {

         if (oldData.at(i) != newData.at(i)) //defefing if block to check count value

         {

             oldData = newData; //assign newData value to oldData value

             break; //using break keyword

         }

         else //defefing else block  

         {  

           cout << "Data matches!" << endl;//print message  

           break; //using break keyword to exit from loop

         }

    }

Explanation:

The full Program to this question can be described as follows:

#include<vector>//defefing header file

#include<stdlib.h>//defefing header file

#include<iostream>//defefing header file

using namespace std;  

int main() //defefing main method

{  

vector<int> oldData(3); //defefing vector array oldData

vector<int> newData(4);//defefing vector array newData

unsigned int i = 0; //defefing integer variable

    oldData.at(0) = 10; //initilizing value oldData  

    oldData.at(1) = 12;//initilizing value oldData  

    oldData.at(2) = 18;//initilizing value oldData  

    newData.at(0) = 25;//initilizing value newData

    newData.at(1) = 27;//initilizing value newData

    newData.at(2) = 29;//initilizing value newData

    newData.at(3) = 23;//initilizing value newData

    for(i=0;i< oldData.size()&&i< newData.size();i++) //defefing loop to assign newData value to oldData value              

    {

         if (oldData.at(i) != newData.at(i)) //defefing if block to check count value

         {

             oldData = newData; //assign newData value to oldData value

             break; //using break keyword

         }

         else //defefing else block  

         {  

           cout << "Data matches!" << endl;//print message  

           break; //using break keyword to exit from loop

         }

    }

    for (i = 0; i < oldData.size(); ++i) //defining loop to print value

    {

         cout << oldData.at(i) << " ";//print oldData value

    }

    return 0;

}

Output:

25 27 29 23  

Description of the program  can be described as follows:

In the above-given program first, we defining header file after defining header files inside the main method two vector array that is "oldData and newData" is declared which assigns some integer value. In the next step, a loop is declared that uses the "i" variable which starts from 0 and ends when both array sizes were same, inside the loop, and if block is declared that interchange value newData to oldData, and use the break keyword. In the next step another for loop is declared that prints the oldData array value.

Related Questions

Consider a TCP connection with a 1ms RTT in which the sender has 50,000 bytes of data to send and there are no losses and no congestion. The receiver has an initial advertised window of 10,000 bytes and reads 2,000 bytes of data once every two seconds. What is the advertised window in bytes after one second

Answers

Answer:

Advertised window in bytes after one second = 0 bytes.

Explanation:

Given:

Sender bytes = 50,000 bytes

Receiver's initial advertised window = 10,000 bytes

Read rate = 2,000 bytes / per 2 second

Find:

Advertised window in bytes after one second = ?

Computation:

We know that, 10,000 bytes have been buffered in receiving initial advertised window.

Receiver read 2,000 bytes in every 2 second.

So, receiver will not able to read anything in 1 second.

Therefore,

Advertised window in bytes after one second = 0 bytes.

Which of the following audio file formats is best
suited for listening to music on a portable audio
device?
(A)BWF
(B)RA
(C)Lossy AIFF
(D)WMA

Answers

Answer:

D. WMA

Explanation:

The following audio file formats that is the best suited for listening to music on a portable audio device is WMA.

Answer:

(D) is the answer WMA

Explanation:

Give the other person brainliest ↑↑↑

                                                        hope it helps

For each of the following, write C++ statements that perform the specified task. Assume the unsigned integer array will be located at 1002500 in memory when the array is declared. An unsigned integer occupies four bytes. The data type of unsigned integer is unsigned. Use the constant integer variable size that is initialized to value 5 to represent the size of the array. The very first element of the array is the 0th element.

Answers

Answer:

The answer is given as below.

Explanation

As the complete question is not given, the complete question is found online and is attached here with.

a)

int values[SIZE] = {2,4,6,8,10};

b)

int *aPtr;

c)

for(i=0;i<SIZE;i++)

printf("%d", values[i]);

d)

aPtr=values;

aPtr=&values[0];

e)

for(i=0;i<SIZE;i++)

printf("%d", *(aPtr+i));

f)

for(i=0;i<SIZE;i++)

printf("%d", *(values+i));

g)

for(i=0;i<SIZE;i++)

printf("%d\n", aPtr[i]);

h)

array subscript notation: values[3]

pointer/offset notation: *(values +3)

pointer subscript notation: aPtr[3]

pointer/offset notation: *(aPtr + 3)

i)

1002512 is the address is referenced by aPtr + 3 and 8 is the value stored at that location.

j)

1002500 is the address referenced by aPtr -= 2 and 2 is stored at that location.

Which type of appliance can host several functions, such as antimalware, firewall, content filter, and proxy server

Answers

Answer:

Web Security Appliance (WSA)

Answer:

utm

Explanation:

UnifiedThreat Management (UTM): A security appliance and/or software tool

which contains a combination of any of the following: antivirus/antimalware, firewall,

proxy server, content filtering, spam filtering, intrusion detection system, intrusion

prevention system, and network access control. The more robust the tool, the

higher the number of features available.

Using the chores.csv file fat the very bottom; write an awk script to return the average number of minutes required to complete a chore. Your solution must handle an undefined number of chores. zero points will be given to solutions that use a static number in their calculation.
Format floating point numbers to 2 decimal places.
Example output;
Average: 28.12
chores.csv
Chore Name,Assigned to,estimate,done?
Laundry,Chelsey,45,N
Wash Windows,Sam,60,Y
Mop kitchen,Sam,20,N
Clean cookware,Chelsey,30,N
Unload dishwasher,Chelsey,10,N
Dust living room,Chelsey,20,N
Wash the dog,Sam,40,N

Answers

Answer: Provided in the explanation section

Explanation:

According to the question:

Using the chores.csv file fat the very bottom; write an awk script to return the average number of minutes required to complete a chore. Your solution must handle an undefined number of chores. zero points will be given to solutions that use a static number in their calculation.

Format floating point numbers to 2 decimal places.

Example output;

Average: 28.12

chores.csv

Chore Name,Assigned to,estimate,done?

Laundry,Chelsey,45,N

Wash Windows,Sam,60,Y

Mop kitchen,Sam,20,N

Clean cookware,Chelsey,30,N

Unload dishwasher,Chelsey,10,N

Dust living room,Chelsey,20,N

Wash the dog,Sam,40,N

ANSWER:

BEGIN{

FS=","

}

{

if(NR!=1)

sum += $3

}

END{

avg=sum/NR

printf("Average: %.2f ", avg)

}' ./chores.csv

cheers i hope this helped !!

Write a script called checkLetter.sh Review Greeting.sh for an example. Use a read statement and ask user to "Enter A, B, or C: "

If user types A, echo "You entered A"
If user types B, echo " You entered B"
If user types C, echo " You entered C"
Use the case structure to test the user’s string.
If user types any letter from lower case ‘a through z’ or upper case ‘D through Z’, echo "You did not enter A, B, or C".

Answers

Answer:

The code is given as below: The input and output is as given for one case.

Explanation:

echo -e "Enter A, B or C : \c" #Printing the line on the screen

read -rN 1 test #read the character in the variable test

echo

case $test in #Setting up the case structure for variable test

[[:lower:]] ) #checking all lower case letters

echo You did not enter A, B or C;;

[D-Z] ) #checking upper case letters from D to Z

echo You did not enter A, B or C;;

A ) #Condition to check A

echo You entered A;;

B ) #Condition to check B

echo You entered B;;

C ) #Condition to check C

echo You entered C;;

esac #Exiting the case structure

Other Questions
What some similarities between capitalism and communism? Find the volume of a right circular cone that has a height of 8.1 in and a base with a diameter of 7.6 in. Round your answer to the nearest tenth of cubic inch Moore (1967) defines social change as a any significant alteration in the social structure, which can originate endogenously and exogenously from any institutions, which in turn make for further adaptations in the original sphere of change. With the above definition, to what extend does the Corona virus Pandemic represents a social change globally? find the loss percentage if cp is 400 rs and sp is 380rs Find the domain and the range of the relation. Determine whether the relation is a function.{(-1,0),(7,0),(-1,9),(-6,-9)} There are 154,000 mg of sugar in acontainer of orange juice at Mindy'shouse. She only wants to have 11 g ofsugar from the orange juice per day.How many days can she drink theorange juice before it is gone? A line passes through (-5, -3) and is parallel to -3x - 7y= 10. The equation of the line in slope-intercept form isY=-3/7x-36/7Y=-3/7x-6/7Y=-7/3x-36/7Y=-7/3x-6/7 Under SEC rules, internal controls over financial reporting (ICFR) are processes that provide reasonable assurance that financial reports are reliable. Which of the following is not assured by ICFR? A. Financial reports, records, and data are accurately maintained. B. Transactions are prepared according to GAAP rules and are properly recorded. C. Unauthorized acquisition or use of data or assets that could affect financial statements will be prevented or detected in a timely manner. D. IT controls that contain financial data are maintained. say true or false with explanation if both sin teta and cos tetanus are negative then teta is thrid quadrant angle. Please help!Find the product AB, if possible. Explain if it's not possible. Evaluating and solving functions Use the function f(x)=240(0.7)^x to answer the following questions. Round your nearest answers to two decimal places. Evaluate f(7) f(7)=Determine x when f()=120 Which organization has encourage free trade , increased economic interdependence, and lessened travel restrictions between European countries? In your opinion, what is the most important function your brain does? Why? what are the effect of not getting some fun Why is "The Celebrated Jumping Frog of Calaveras County" a good example of Regionalism? please help me, i don't get this In which two ways will a dog contribute to the carbon cycle Point s is not on line k. How many different planes contain both point s and line k? Solve for x in the diagram below.(2x + 304040 Find all the real zeros f(x)=-2x^2-6x-1