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
elena-14-01-66 [18.8K]
4 years ago
12

Write a program to help a travelling sales person keep up with their daily mileage driven for business. In your main method, the

program should first ask the user how many days of mileage they want to enter and then collect the user input for each day's miles, storing the values entered in an appropriately sized array.
Computers and Technology
1 answer:
Lelu [443]4 years ago
5 0

Answer:

The programming language is not stated;

<em>The program written in C++ is as follows (See Explanation Section for detailed explanation);</em>

#include<iostream>

using namespace std;

int main()

{

 int numdays;

 cout<<"Number of days of mileage: ";

 cin>>numdays;

 int miles[numdays];

for(int i=0;i<numdays;i++)

{

 cout<<"Miles traveled on day "<<i+1<<": ";

 cin>>miles[i];

}

 int total = 0;

 for(int i=0;i<numdays;i++)

{

 total+=miles[i];

}

cout<<"Total mileage traveled: "<<total;

 return 0;

}

Explanation:

This line declares the number of days of mileage

 int numdays;

This line prompts user for days of mileage

 cout<<"Number of days of mileage: ";

This line accepts input from the traveler for days of mileage

 cin>>numdays;

This line creates an array

 int miles[numdays];

The italicized is an iteration that collects the user input for each day

<em> for(int i=0;i<numdays;i++)</em>

<em> {</em>

<em>  cout<<"Miles traveled on day "<<i+1<<": ";</em>

<em>  cin>>miles[i];</em>

<em> }</em>

This line initializes variable to 0

 int total = 0;

The italicized is an iteration that adds up the mileage traveled by the traveler each day  

<em>  for(int i=0;i<numdays;i++)</em>

<em> {</em>

<em>  total+=miles[i];</em>

<em> }</em>

This line prints the total miles traveled

cout<<"Total mileage traveled: "<<total;

You might be interested in
You're the administrator for a large bottling company. At the end of each month, you routinely view all logs and look for discre
Natali [406]

Answer:

It seems as though it would be a DDoS attack.

Explanation:

The characteristics are as follows:

A slow down of operations and attempting to get access into said service.

4 0
3 years ago
Which command must you use at the command prompt to determine the names of the network interfaces (including the isatap interfac
spayn [35]

ipconfig /all is operate at the command prompt to specify the names of the network interfaces (including the isatap interfaces) on a windows 7 computer.

<h3>What is Network interfaces?</h3>

A network interface exists the network-specific software that communicates with the network-specific device driver and the IP layer to furnish the IP layer with a consistent interface to all network adapters that might be present. The network interface may direct to Network interface controller, a computer hardware element that connects a computer to a computer network Network interface device, a device that functions as the demarcation.

config exists a console application program of some computer operating systems that shows all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol and Domain Name System settings.

Hence, ipconfig /all is operate at the command prompt to specify the names of the network interfaces (including the isatap interfaces) on a windows 7 computer.

To learn more about Network interfaces refer to:

brainly.com/question/20689912

#SPJ4

3 0
2 years ago
Angelika just submitted her product for the first time, and she had 2 errors, 3 warnings, and 5 notifications. What does she nee
skelet666 [1.2K]

vvhooi. cucuxcuh gxzuzn

5 0
4 years ago
Read 2 more answers
Evan accidentally entered an incorrect word when he was typing a document. Which keyboard shortcut should he use to undo the err
agasfer [191]
CTRL Z is the redo action so thats your best bet
8 0
3 years ago
Read 2 more answers
Is this website real? Or is it a scam?
nikitadnepr [17]

It's a scam don't buy something

5 0
3 years ago
Other questions:
  • What operating system type uses icons to represent programs
    9·2 answers
  • An automated search feature used by search engines to find results that match your search terms is called a spider or ?
    5·1 answer
  • Technician A says that almost every part of a vehicle is somehow powered by or controlled by an electrical or electronic system.
    9·2 answers
  • Which of the following is a scam in which a perpetrator sends an official looking e-mail that attempts to obtain a user’s person
    7·2 answers
  • Suppose you have four 500 MB hard drives plus one 2 GB flash drive. How many GB of capacity is this overall?
    12·1 answer
  • In this problem, you will write three methods to:
    12·1 answer
  • Match letters from column B to Column A by looking at the picture above.
    11·1 answer
  • Why concurrency control is needed in transaction.
    5·1 answer
  • Chief technology officers can influence a company's current and future ____.
    9·1 answer
  • Three PCs are on an Ethernet LAN, connected by a hub. Describe how the Ethernet protocol deals with collisions in this situation
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!