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
victus00 [196]
3 years ago
9

Assume that PrecinctReport is a structured type with these fields, address (a string), and three int fields which are counts of

crimes in the given precinct: felonies, murders, and robberies. Assume that NPRECINCTS is a pre-declared int constant and that an array named allPrecincts with NPRECINCTS elements, each of type PrecinctReport has been declared and initialized Assume that an int variable murderCount has been declared. Write the necessary code that traverses the allPrecincts array and adds up all the murder counts storing the resulting total in murderCount.
Computers and Technology
1 answer:
monitta3 years ago
8 0

Answer:

Explanation:

#include <iostream>

#include <string>

#include <cstdlib>

#include <ctime>

using namespace std;

const int NPRECINCTS = 5;

typedef struct PReport

{

string address;

int felonies, murders, robberies ;

}PrecinctReport;

int murderCount(PrecinctReport all[])

{

int sum=0;

for(int i=0;i<NPRECINCTS;i++)

sum+=all[i].felonies + all[i].murders + all[i].robberies;

return sum;

}

int main()

{

PrecinctReport allPrecincts[NPRECINCTS];

for(int i=0;i<NPRECINCTS;i++)

{

cout<<"Enter the address of the "<<i+1<<": ";

cin>>allPrecincts[i].address;

cout<<"\nEnter the felonies of the "<<i+1<<": ";

cin>>allPrecincts[i].felonies;

cout<<"\nEnter the murders of the "<<i+1<<": ";

cin>>allPrecincts[i].murders;

cout<<"\nEnter the robberies of the "<<i+1<<": ";

cin>>allPrecincts[i].robberies;

cout<<"\n \n";

}

cout<<"Total murders : "<<murderCount(allPrecincts)<<endl;

return 0;

}

You might be interested in
Given a link with a maximum transmission rate of 18 Mbps. Only two computers, X and Y, wish to transmit starting at time t = 0 s
expeople1 [14]

Answer:

<em>Total time taken = 0.62 seconds </em>

Explanation:

<em>Transmission rate =  18 Mbps</em>

The size of file X winch will go fast= 11.73 MiB (Mebibyte) = 8.38 Mb(Megabit)  

The time it will take to transfer = File size / Transmission rate

                                                = 8.38 / 18 seconds

                                                = 0.46 seconds  

Mb in 1 KiB = 116.415  

The file Y that will go next has size = 340 Kib

                                                       = 340 / 116.41 Mb

                                                       = 2.92 Mb  

The time it will take to transfer = 2.92 / 18 seconds

                                                = 0.16

<em>Total time = Time taken for file X + Time taken for file Y </em>

<em>= 0.46 + 0.16 </em>

<em>= 0.62 </em>

<em />

3 0
4 years ago
WILL MARK BRAIN LIST!
Maslowich
I think it’s a

if it isn’t a then it’s d
6 0
3 years ago
Read 2 more answers
Algorithm and flowchart to find the perimeter and area of square​
kupik [55]

Answer:

I can give you the perimeter "algorithm" but not the flowchart.

Here you go:

p = w * 4

p = perimiter,

w = width/height

4 = the amount of sides needed.

perimeter = width * 4

to include both width and height, we would instead use:

perimeter = 2(width+height)

This also works with rectangles ^

--------------------------------------------------------------------------

To find an area, it is just width * height. This is also compatible with rectangles.

4 0
3 years ago
State the steps for opening Ms word Application ​
Charra [1.4K]

Answer:

Step 1: From the desktop or from your 'Start' menu, open Microsoft Word. Step 2: Click either File or the Office button at the top left. Select Open and browse to the document you wish to open. Double-click on it with your left-hand mouse button to open it.

Explanation:

PLZ MARK AS THE BRAINLIEST

HAVE A GOOD DAY

: )

4 0
3 years ago
A specified group of banks get together and agree to use a blockchain for wholesale settlement of interbank transfers. This is m
Minchanka [31]

Answer:

Permissioned

Explanation:

In this scenario, specified group of banks got together and joined forces by agreeing to use a blockchain for wholesale settlement of all interbank transfers. Thus, this is most likely an example of a permissioned blockchain.

8 0
3 years ago
Other questions:
  • Which color reflects more light red blue black or white
    6·1 answer
  • In which step of web design is storyboarding helpful?
    14·1 answer
  • There are four types of alignment available from on the Home ribbon toolbar. They include all of the following except
    13·1 answer
  • Why is it important to use the binomial nomenclature system?
    6·1 answer
  • A feature that displays in the lower right corner of a selected range with which you can analyze your data by using Excel tools
    12·2 answers
  • Why does this app say im following a question? how do i make it stop?​
    14·2 answers
  • Which of the following is not a natural resource
    11·2 answers
  • What is Mark Dean’s main contribution to the development of the computer?
    9·1 answer
  • What the three factors that AI is using for information gathering
    7·1 answer
  • As we’ve discussed, computer programs are considered creative works and are protected by copyright. That means those programs be
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!