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
Which word from the passage best explains what the web in the passage symbolizes
frez [133]

Answer:

I cant see the passage

Explanation:

I cant see the passage

6 0
3 years ago
If the electric field just outside a thin conducting sheet is equal to 1.5 N/C, determine the surface charge density on the cond
Dennis_Churaev [7]

Answer:

The surface charge density on the conductor is found to be 26.55 x 1-6-12 C/m²

Explanation:

The electric field intensity due to a thin conducting sheet is given by the following formula:

Electric Field Intensity = (Surface Charge Density)/2(Permittivity of free space)

From this formula:

Surface Charge Density = 2(Electric Field Intensity)(Permittivity of free space)

We have the following data:

Electric Field Intensity = 1.5 N/C

Permittivity of free space = 8.85 x 10^-12 C²/N.m²

Therefore,

Surface Charge Density = 2(1.5 N/C)(8.85 x 10^-12 C²/Nm²)

<u>Surface Charge Density = 26.55 x 10^-12 C/m²</u>

Hence, the surface charge density on the conducting thin sheet will be 26.55 x 10^ -12 C/m².

7 0
3 years ago
B1) 20 pts. The thickness of each of the two sheets to be resistance spot welded is 3.5 mm. It is desired to form a weld nugget
kap26 [50]

Answer:

minimum current level required =  8975.95 amperes

Explanation:

Given data:

diameter = 5.5 mm

length = 5.0 mm

T = 0.3

unit melting energy = 9.5 j/mm^3

electrical resistance = 140 micro ohms

thickness of each of the two sheets = 3.5mm

Determine the minimum current level required

first we calculate the volume of the weld nugget

v = \frac{\pi }{4} * D^2 * l = \frac{\pi }{4} * 5.5^2 * 5 = 118.73 mm^3

next calculate the required melting energy

= volume of weld nugget * unit melting energy

= 118.73 * 9.5 = 1127.94 joules

next find the actual required electric energy

= required melting energy / efficiency

= 1127 .94 / ( 1/3 )  = 3383.84 J

TO DETERMINE THE CURRENT LEVEL REQUIRED  use the relation below

electrical energy =  I^2 * R * T

3383.84 / R*T = I^2

3383.84 / (( 140 * 10^-6 ) * 0.3 ) = I^2

therefore  8975.95 = I ( current )

4 0
3 years ago
Why do you suppose a value of 5 is used? Do you think other values might work?
Shtirlitz [24]

Answer:

YES

Explanation:

values other than five will work

3 0
2 years ago
Which permission do you need to shoot on the owner’s property?
Elena L [17]

Answer:

filming permit,

( MARK ME BRAINLIEST!!)

4 0
2 years ago
Other questions:
  • There are two piston-cylinder systems that each contain 1 kg of an idea gas at a pressure of 300 kPa and temperature of 350 K. T
    8·1 answer
  • According to information found in an old hydraulies book, the energy loss per unit weight of fluid flowing through a nozzle conn
    6·1 answer
  • How to build a laser pointer?
    12·1 answer
  • You will create three classes, the first two being Student and LineAtOfficeHour. The instances of the first class defines a sing
    8·1 answer
  • A block of mass M rests on a block of mass M1 = 5.00 kg which is on a tabletop. A light string passes over a frictionless peg an
    14·1 answer
  • Find the general solution of the equation<br>a) Tan A = 1/√3​
    11·1 answer
  • Plz give solutions..... ​
    6·1 answer
  • . An ideal vapor compression refrigeration cycle operates with a condenser pressure of 900 kPa. The temperature at the inlet to
    14·1 answer
  • ¿Cuál es el objetivo de la participación del gobierno en la economía?
    6·1 answer
  • Example 12: Write an algorithm and draw a flowchart to calculate
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!