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
emmainna [20.7K]
4 years ago
6

In C++ :

Computers and Technology
1 answer:
elena-s [515]4 years ago
8 0

Answer::

//Program is written in C++ Programming Language

// Comments are used for explanatory purpose

#include

#include

#include

#include

using namespace std;

int main(){

ifstream file; // File stream object

string name; // To hold the file name

string inputLine; // To hold a line of input

int lines = 0; // Line counter

int lineNum = 1; // Line number to display

// Get the file name.

cout << "Enter the file name: ";

getline(cin, name);// Open the file.

file.open(name.c_str());// Test for errors.

if (!file){

// There was an error so display an error

// message and end the PROGRAM.

cout << "Error opening " << name << endl;

exit(EXIT_FAILURE);

}

// Read the contents of the file and display

// each line with a line number.

// Get a line from the file.

getline(file, inputLine, '\n');

while (!file.fail()){

// Display the line.

cout << setw(3) << right << lineNum<< ":" << inputLine << endl;

// Update the line DISPLAY COUNTER for the next line.

lineNum++;// Update the total line counter.

lines++;// If we've displayed the 24th line, pause the screen.

if (lines == 24){

cout << "Press ENTER to CONTINUE...";

cin.get();

lines = 0;

}

// Get a line from the file.

getline(file, inputLine, '\n');}

//Close the file.

file.close();

return 0;}

You might be interested in
What happens if a computer lags too much?
Makovka662 [10]

Answer:

it can overheat trying to process and from there multiple things may happen

1. the computer will recognise its overheating and automatically shutdown

2. the computer with catch on fire

3. the computer with crash the program and go back to the home screen

Explanation:

7 0
3 years ago
Read 2 more answers
Marla wants to transfer photos from her digital camera to her computer. She has plugged the camera's cord into the USB port. Wha
QveST [7]
She needs to make sure the camera is on and working, if she doesn't than it wont tranfer
3 0
3 years ago
Read 2 more answers
Fill in the correct term to complete the statement. _____ refers to borrowing money from a bank.
Vera_Pavlovna [14]

taking a guess here : a lone.

hope this helps.

4 0
3 years ago
Read 2 more answers
If Tamya makes $1000.00 gross monthly income and her total payroll deductions are $294.00, what is her net income?
Maru [420]

Answer:

$751

Explanation:

From the question we have the following information;

Gross income = $1000.00

Deductions =   $294.00

Now we know that;

Net income = Gross income - Deductions

Therefore;

Net income = $1000.00 -  $294.00

Net income = $751

7 0
3 years ago
W-11/6=4<br><img src="https://tex.z-dn.net/?f=%20%20%5Cfrac%7Bx%20-%2011%20%7D%7B%206%7D%20%20%3D%204" id="TexFormula1" title="
kozerog [31]

step 1, multiply by 6:

x-11 = 4*6 = 24

step 2, add 11:

x = 35

7 0
3 years ago
Other questions:
  • Which of the following is NOT a group on the Slide Master tab?
    6·1 answer
  • Write a function called median, that takes as parameter a full, sorted array of doubles and returns the median of the list. For
    15·1 answer
  • what tool can a student use to make sure his or her work paper does not take credit for someone else's work ?
    5·1 answer
  • Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with e
    11·1 answer
  • Program ____ use graphical symbols and relational operators (such as &lt; for "less than" and = for "equal to") to portray the s
    8·1 answer
  • The process of combining rows and columns in a table is called _____.
    8·1 answer
  • You scan the network and find a counterfeit access point that is using the same SSID as an already existing access point. What i
    12·1 answer
  • 5. Compare the telephone network and the internet. What are the similarities? What are the differences?
    12·1 answer
  • Please answer this simple (hard) question for me lol
    13·2 answers
  • Area Triangolo Rettangolo in c++
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!