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]
3 years ago
6

In C++ :

Computers and Technology
1 answer:
elena-s [515]3 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
Given the following structure and variable definitions, struct customer { char lastName[ 15 ]; char firstName[ 15 ]; unsigned in
garri49 [273]

Answer:

see explaination

Explanation:

a)

customerRecord.lastName

b)

customerPtr->lastName or (*customerPtr).lastName

c)

customerRecord.firstName

d)

customerPtr->firstName or (*customerPtr).firstName

e)

customerRecord.customerNumber

f)

customerPtr->customerNumber or (*customerPtr).customerNumber

g)

customerRecord.personal.phoneNumber

h)

customerPtr->personal.phoneNumber or (*customerPtr).personal.phoneNumber

i)

customerRecord.personal.address

j)

customerPtr->personal.address or (*customerPtr).personal.address

k)

customerRecord.personal.city

l)

customerPtr->personal.city or (*customerPtr).personal.city

m)

customerRecord.personal.state

n)

customerPtr->personal.state or (*customerPtr).personal.state

o)

customerRecord.personal.zipCode

p)

customerPtr->personal.zipCode or (*customerPtr).personal.zipCode

6 0
2 years ago
Star and peer-to-peer are types of
Naily [24]
Networks? i’m not sure, but i know peer-to-peer is a type of network. i’m not sure about lending though
3 0
2 years ago
Read 2 more answers
When an Ethernet NIC has been configured by the OS to use half-duplex, the transmit pair of the twisted-pair cable usestransmiss
zzz [600]

Answer:

C

Explanation:

When an Ethernet NIC has been configured by the OS to use half-duplex, the transmit pair of the cable uses SIMPLEX transmissions, the receive pair in the SIMPLEX transmissions, and the twisted pair cable uses HALF-DUPLEX transmissions.

Cheers

7 0
3 years ago
"Explain the functionality of the different layers found in the network protocol stack of an operating system such as Linux"
arsen [322]

Answer:

There are 7 layers in linux.

Explanation:

As networking is difficult and complex.

Imagine if every application had to know how to communicate on every step that would be more than just complex. So, rather than reinvent something which will help it to communicate let’s just make something that will automatically controls the communication and for that protocols came in to live.

As for the linux operating system, it is not exceptional from other operating systems.

There are 7 layers on network protocol stack use to communicate with other network protocol stack.

1. Application layer

2. System call interface

3. Protocol agnostic interface

4. Network protocol

5. Device agnostic interface

6. Device drivers

7. Physical hardware

All the layers vary in their functionality.

One more important thing to remember is that the network protocol stack layers is not one way its 2 way communication. First, when a client request to a network and second, when the request is full filled.

The top most layer is a part of user space, the next five layers comes in the kernel space and the final layer is the physical layer.

<u>Application layer: </u>

When a client or user request to  a network the request initially comes to this layer.

On this layer we use tcp/ip protocol.

<u>System call interface(SCI): </u>

When application layer make a call to the kernel this layer handles that call. And take the request to the next layer.

<u>Protocol agnostic interface: </u>

This layer has two functions “talking” or “listening”. There is a thing called sockets which perform these functions and each socket has an id which is used specifically for an application.

<u>Network protocol: </u>

This layer is used for how the data is sent or received.

<u>Device agnostic interface: </u>

It is used to connect data from/to kernel user space and the network device drivers which allows the data to prepare itself for transmission over the medium from the network device.

<u>Physical hardware : </u>

This layer is responsible for the data packets transmission and received from the network medium being used whether cable or wireless.

5 0
3 years ago
Calculate the average high and low in python code for beginners pls
Nikolay [14]

Answer:

There are two ways to find the average of a list of numbers in Python. You can divide the sum() by the len() of a list of numbers to find the average. Or, you can find the average of a list using the Python mean() function

Explanation:

3 0
3 years ago
Other questions:
  • Put the following five steps in the order in which you would perform them to use the Paste Special function: ____. 1. Select and
    5·1 answer
  • Describe how you center text.
    7·2 answers
  • Which is an advantage that electronic scheduling tools have over paper calendars?
    13·2 answers
  • A company has its branches spread over five places in a state. It has become difficult for employees to transfer information and
    7·1 answer
  • what is the total resistance of a series circuit with four resistors in series of 12 16 20 and 24 ohms​
    14·1 answer
  • Big data refers to huge collections of data that are difficult to process, analyze, and manage using conventional data tools. It
    13·1 answer
  • A selected graphic appears surrounded by a(n) ______, which has small squares and circles around its edges.
    7·1 answer
  • Which of the following should you do if your accelerator is stuck? A. Pump your brakes to build fluid pressure. B. Shift to Neut
    14·2 answers
  • What is connected to the base unit in Desktop PC?
    14·1 answer
  • Can somebody please help me with these few questions?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!