Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 3 is built upon program 2. I need help read the integer pairs from program 2 and displaying the data as program 3 states.

Program 3 is built upon program 2. I need help read the integer pairs from program 2 and displaying the data as program 3 states. I have done program 2 but need help with program 3.
Program 3
image text in transcribed
Program 2
image text in transcribed
This program is in C.
This program will use the file created in Program 2. The program should read the integer pairs from the "image.dat" file and display the data read in two forms. The first form is the character - integer pairing and should be displayed as (character, integer). The other form can be thought of as the pairings decoded form; the character - integer pairing ( 'b',6) would be decoded as 'bbbbbb'. For this exercise you must write a program which generates a set of random integer pairs and stores them in a binary file using system calls. The program should meet the following criteria: 1. The program should be named createFile 2. The program should be able to be called in one of two ways: 1. createFile 2. createFile The command line arguments represent the following: - -name of the binary file, if the value isn't specified default it to image.dat - - total number of integer pairs to generate, if this value isn't specified default it to 60 The createFile program will follow a simple process: 1. loop while all the integer pairs haven't been written to the file 1. generate a random number between 97 and 122; these are the ASCII values for ' a ' ' z '. 2. generate a random number between 5 and 20 3. store the values in a struct containing a char and a short int 4. output the struct to the file using write

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions

Question

1.Which are projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

What are the classifications of Bank?

Answered: 1 week ago