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
aksik [14]
3 years ago
15

Open the"stateData3.c" program and try to understand how the tokenization works. If you open the input file "stateData.txt", you

can clearly seethat a comma separates the state name and its population. The tokenizer portion of the programs separates each line into two tokens and stores them into two different arrays. You need to display the arrayelements such that each line has a state and itspopulation. Also calculate the total population of USA.Then,examine the portion of the code how it writes the array elements into a binary datafile.You need to write similar logic where it writes the array elements into a text file "stateDataOutput2.txt". Please check the syntax and usage of fprintf(); and use that here.
Engineering
1 answer:
babymother [125]3 years ago
5 0

Answer:

Kindly see explaination

Explanation:

Code

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#define size 200

int main(void)

{

int const numStates = 50;

char tempBuffer[size];

char tmp[size];

char fileName[] = "stateData.txt"; // Name of the text file (input file) which contains states and its populations

char outFile[] = "stateDataOutput1.txt"; // Output file name

// Open the input file, quit if it fails...

FILE *instream = fopen(fileName, "r");

/* Output File variable */

FILE *opstream;

if(instream == NULL) {

fprintf(stderr, "Unable to open file: %s\n", fileName);

exit(1);

}

//TODO: Open the output file in write ("w") mode

/* Opening output file in write mode */

opstream = fopen(outFile, "w");

//TODO: Read the file, line by line and write each line into the output file

//Reading data from file

while(fgets(tmp, size, instream) != NULL)

{

//Writing data to file

fputs(tmp, opstream);

}

// Close the input file

fclose(instream);

//TODO: Close the output file

/* Closing output file */

fclose(opstream);

return 0;

}

You might be interested in
15- Vipsana's Gyros House sells gyros. The cost of ingredients (pita, meat, spices, etc.) to make a gyro is $2.00. Vipsana pays
sineoko [7]
D is a great answer
4 0
2 years ago
How many hours should I charge a 4.8v 600mah battery (I need it by today please)
prohojiy [21]

The number of hours that will be needed to charge a 600mah battery will be 1.5 hours.

<h3>What is a battery?</h3>

It should be noted that an electric battery simply means a source of electric power that consist of one or more electrochemical cells that are with external connections that are important for powering electrical devices.

It should be noted that when a battery is supplying power, then the positive terminal is the cathode while the negative terminal is the anode.

In conclusion, the number of hours that will be needed to charge a 600mah battery will be 1.5 hours.

Learn more about battery on:

brainly.com/question/16896465

#SPJ1

5 0
2 years ago
If a vacuum gau ge reads 9.62 psi, it means that: a. the very highest column of mercury it could support would be 19.58 inches.
scZoUnD [109]

Answer:All of the above

Explanation:

9.62 psi means 497.49 mm of Hg pressure

for (a)19.58 inches is equals to 497.49 mm of Hg

(b)atmospheric pressure is 14.69 psi

vaccum gauge is 9.62psi

absolute pressure is=14.69-9.62=5.07

(c)vaccum means air is sucked and there is negative pressure so it tells about below atmospheric pressure.

thus all are correct

8 0
3 years ago
What are the searching algorithms used by search engines?
Juliette [100K]
Search engines use specific algorithms based on their data size and structure to produce a return value.
Linear Search Algorithm. ...
Binary Search Algorithm. ...
Relevancy. ...
Individual Factors. ...
Off-Page Factors.
6 0
2 years ago
A negative pressure respirator brings fresh air to you through a hose<br>A) True<br>B)False​
madreJ [45]

Answer:FALSE

Explanation: A negative pressure respirator is a respiratory system which is known to have a low air pressure inside the mask when compared to the air pressure on the outside during Inhalation.

Most of the personal protective equipment (PPE) which are in use in various industries are examples of Negative pressure respirator device,any leak or damage done to the device will allow the inflows of harmful and toxic Air into the person's respiratory system. AIR SUPPLY SYSTEMS ARE KNOWN TO SUPPLY FRESH UNCONTAMINATED AIR THROUGH AIR STORED INSIDE COMPRESSED CYLINDERS OR OTHER SOURCES AVAILABLE.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following scenarios describes someone who is a materials engineer?
    13·1 answer
  • Explain the use of remote sensing in surveying.​
    8·1 answer
  • A heat engine that receives heat from a furnace at 1200°C and rejects waste heat to a river at 20°C has a thermal efficiency of
    14·1 answer
  • A 26-tooth pinion rotating at a uniform 1800 rpm meshes with a 55-tooth gear in a spur gear reducer. Both pinion and gear are ma
    11·1 answer
  • can someone please define these three vocabulary words for my stem class i will give brainliest if i can figure out how
    15·1 answer
  • While recharging a refrigerant system, the charging stops before the required amount of refrigerant has been inserted. What shou
    8·1 answer
  • ) A flow is divided into two branches, with the pipe diameter and length the same for each branch. A 1/4-open gate valve is inst
    5·1 answer
  • How do you get your drivers lisnes when your 15
    8·1 answer
  • The percentage modulation of AM changes from 50% to 70%. Originally at 50% modulation, carrier power was 70 W. Now, determine th
    15·1 answer
  • ceramics must be heated in order to harden the clay and make it durable. the equipment used to heat the clay
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!