Write a c program that reads a .img file by rows and columns and
prints out the arrays. The .img file contains h(the
height) and w(the width) of the text size. An example .img
file would be:
2 4
DFJSK
HJ5JF
HFDY5
Write a Fortran program that is able to read in
the data file.
The file has lines with the structure: 19990122 88888 30.5
Where:
i) the first is an 8 digit code with the date: yyyymmdd (yyyy is
the year, mm is the month, and dd is the day)
ii) the second is the five digit odometer reading of a car
iii) the third is the amount of fuel put into the car on that
date to fill the tank...
Write a C program that creates a structure and displays its
content. • Create a struct that will be used to hold a student's
name, age, and year in school (Freshman, Sophomore, Junior, or
Senior) • Within function main, dynamically allocate space to hold
the structure and assign a pointer to point to the memory space
allocated • Read in (from the keyboard) the student's name, age,
and year in school • Create a separate function with the prototype:
void...
Write a C++ program that creates a file called
Readings.txt. Inside the file, your program must
create
a list. The list is composed of integer double pairs. There is one
pair per line. The integers are in
sequence (0, 1, 2, 3, ...) beginning with zero and ending with some
random value between 512 and
1024. The doubles should be random values between 50.000 and
90.000. The doubles only have 3
decimal places. The file should look like this (of...
Write a java program:
Write a program that creates a text file. Write to the file
three lines each line having a person's name. In the same program
Append to the file one line of 'Kean
University'. In the same program then Read the file and
print the four lines without lines between.
Using OOP, write a C++ program that will read in a file of
names. The file is called Names.txt and should be located in the
current directory of your program. Read in and store the names into
an array of 30 names. Sort the array using the selection sort or
the bubblesort code found in your textbook. List the roster of
students in ascending alphabetical order. Projects using global
variables or not using a class and object will result in...
Write a C program to run on unix to read a text file and print
it to the display. It should count of the number of words in the
file, find the number of occurrences of a substring, and take all
the words in the string and sort them (ASCII order). You must use
getopt to parse the command line. There is no user input while this
program is running.
Usage: mywords [-cs] [-f substring] filename
• The -c flag...
Write a
program that creates an output file named rand_nums.txt.
Open the file and write 100 random integers between -50 and +50
(inclusive) to the file. Be sure to handle any file IO exceptions.
Remember to close the file.
Write a
program that opens rand_nums.txt
for input.
Create two output files pos.txt
and
neg.txt.
Read through the input file, one line at a time, converting each
line into an integer (no exception handling, yet). If the number is
positive, write...
Done in C++, Write a program to read the input file, shown below
and write out the output file shown below. Use only string objects
and string functions to process the data. Do not use c-string
functions or stringstream (or istringstream or ostringstream) class
objects for your solution.
Input File
Cincinnati 27, Buffalo 24
Detroit 31, Cleveland 17
Kansas City 24, Oakland 7
Carolina 35, Minnesota 10
Pittsburgh 19, NY Jets 6
Philadelphia 31, Tampa Bay 20
Green Bay 19,...
write a Program in C++
Using a structure (struct) for a timeType, create a program to
read in 2 times into structures, and call the method addTime, in
the format:
t3 = addTime(t1, t2);
Make sure to use add the code to reset and carry, when adding 2
times. Also, display the resultant time using a function:
display(t3);