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
A square-thread power screw has a major diameter of 32 mm and a pitch of 4 mm with single threads, and it is used to raise a loa
Valentin [98]

Answer:

54mm.

Explanation:

So, we are given the following data or parameters or information that is going to assist in solving this type of question efficiently;

=> "A square-thread power screw has a major diameter of 32 mm"

=> "a pitch of 4 mm with single threads"

=> " and it is used to raise a load putting a force of 6.5 kN on the screw."

=> The coefficient of friction for both the collar and screw is .08."

=> "If the torque from the motored used to raise the load is limited to 26 N×M."

Step one: determine the lead angle. The lead angle can be calculated by using the formula below;

Lead angle = Tan^- (bg × T/ Jh × π ).

=> Jh = J - T/ 2. = 32 - 4/2. = 30mm.

Lead angle = Tan^- { 1 × 4/ π × 30} = 2.43°.

Step two: determine the Torque required to against thread friction.

Starting from; phi = tan^-1 ( 0.08) = 4.57°.

Torque required to against thread friction = W × Jh/2 × tan (lead angle + phi).

Torque required to against thread friction =( 6500 × 30/2) × tan ( 2.43° + 4.57°). = 11971.49Nmm.

Step three: determine the Torque required to against collar friction.

=> 2600 - 11971.49Nmm = 14028.51Nmm.

Step four = determine the mean collar friction.

Mean collar friction = 14028.51Nmm/0.08 × 6500 = 27mm

The mean collar diameter = 27 × 2 = 54mm.

5 0
3 years ago
Determine the initial void ratio, the relative density and the unit weight (in pounds per cubic foot) of the specimens for each
Elina [12.6K]

The initial void ratio is the <em>parameter </em>which is used to show the structural foundations for each <em>specimen of sand </em>so that the method and speed of compression would be <em>measured</em>.

Relative density is the mass per unit volume of each specimen of sand which is <em>measured </em>and it has to do with the<em> relative ratio</em> of the density of the sand.

Unit weight is the the exact weight per cubic foot of the sand which is measured.

Please note that your question is incomplete so I gave you a general overview to help you better understand the concept

Read more here:

brainly.com/question/15220801

5 0
2 years ago
a metal rod 24mm diameter and 2m long is subjected to an axial pull of 40 kN. If the rod is 0.5mm, then find the stress-induced
ozzi

Answer:

i dont know but i will take the points tho hahah

Explanation:

8 0
2 years ago
La base de los tema relacionados a las ciencia de las ingeniería es?
Yanka [14]

Answer:

La ciencia y la ingeniería conciben el mundo como comprensible, con reglas que gobiernan su funcionamiento y que a través de un estudio cuidadoso y sistemático se puede evidenciar mediante patrones consistentes que permitan la oportunidad de examinar las características fundamentales que mejor describen los fenómenos.

Explanation:

5 0
3 years ago
"Mass burn technology uses unprocessed municipal solid waste to generate heat which is used to produce electricity."
Flura [38]

Answer:

True

Explanation:

Mass burn technology is a type of waste-to-energy technology commonly used in the mass-burn system, where unprocessed municipal solid waste is burned in a large incinerator with a boiler, to  generate heat used in the production of electricity.

6 0
3 years ago
Read 2 more answers
Other questions:
  • How an AK 47 gun was works​
    14·1 answer
  • Create a function (prob3_5) that will take inputs of vectors x and y in feet, scalar N, scalars L and W in feet and scalars T1 a
    6·1 answer
  • HELLO <br> Can you please Suggest me some FYP ideas <br> #Software_Engineering
    6·1 answer
  • A 150-lbm astronaut took his bathroom scale (a spring scale) and a beam scale (compares masses) to the moon where the local grav
    13·1 answer
  • When we utilize a visualization on paper/screen, that visualization is limited to exploring: Group of answer choices Relationshi
    9·1 answer
  • List two possible reasons the engine oil could have a strong gasoline smell
    15·1 answer
  • Explain why surface temperature increases when two bodies are rubbed against each other. What is the significance of temperature
    13·1 answer
  • Before turning in a test, it would be best to
    6·2 answers
  • 1. You are asked to write a report about one of the structures that Transportation Engineers
    9·1 answer
  • Whose responsibility is it to provide direction on correct ladder usage?<br> select the best option.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!