Write a program that asks the user for the name of a file

Assignment Help Computer Engineering
Reference no: EM132100889

Please use C++ programming

1. File "HEAD" program:

Write a program that asks the user for the name of a file. The program shold display the first 10 lines of the file on the screen (the "head" of the file). If the file has fewer than 10 lines, the entire file should be displayed, with a message indicating the entire file has been displayed.

2. File Display Program.

Write a program that asks the user for the name of a file. The program should display the contents of the file on the screen. If the file's contents won't fit on a single screen, the program should display 24 lines of output at a time, and then pause. Each time the program pauses it should wait for the user to strike a key before the next 24 lines are displayed.

3. Data Conversion Program

Write a program that reads data from a file, performs a units conversion, and writes the data to a new file. Offer the user the following choices of conversions: degrees F to degrees C, degrees C to degrees F, feet to meters, meters to feet, ounces to grams, grams to ounces.

In the new file, the first line of the file should indicate the original units and the altered units, and the next lines should have both the input and the converted data. For example:

INPUT:

32.0
0
72

OUTPUT:

degrees F degrees C
32 0
0 -17.78
72 22.22

Reference no: EM132100889

Questions Cloud

Calculate the change in momentum : A 10.0g marble slides to the left with a velocity of magnitude 0.400 m/s on the frictionless, horizontal surface of an icy New York sidewalk and has a head-on.
Write a program that asks the user for a password : Write a program that asks the user for a password and verifies that it meets the stated criteria.
What is the tension in the rope : The 1.0 kg block in the figure below is tied to the wall with a rope. It sits on top of the 2.0 kg block. The lower block is pulled to the right with a tension.
Write a function that accepts a pointer to a c-string : Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string.
Write a program that asks the user for the name of a file : Write a program that asks the user for the name of a file. The program shold display the first 10 lines of the file on the screen (the "head" of the file).
What is the mass of the cup : A 100g ice cube at -10 degrees C is placed in an aluminum cup whose initial temperature is 70 degrees C. The system comes to an equilibrium temperature.
Determine how many lines in myloginfile contain string : Create a file called myloginfile that shows all login information on your server since "Aug 24," and then write an awk script.
What would the voltmeter read : A 10.0 uF parallel-plate capacitor is connected to a 12.0 V battery. After the capacitor is fully charged, the battery is disconnected without loss.
Budgets during times of rapidly rising product costs : Identify three specific actions you would recommend such managers take to stay within their budgets during times of rapidly rising product costs.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd