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
blagie [28]
3 years ago
9

A car with a 20-gallon gas tank averages 23.5 miles per gallon when driven in town and 28.9 miles per gallon when driven on the

highway. write a program that calculates and displays the distance the car can travel on one tank of gas when driven in town and when driven on the highway
Computers and Technology
1 answer:
katovenus [111]3 years ago
5 0
Highway: 
<span>cout << "The car can drive " << 20*26.8 << " miles on the highway." << endl; </span>
<span>Town: </span>
<span>cout << "The car can drive " << 20*21.5 << " miles in the town." << endl;</span>
You might be interested in
Which type of operation writes the file system structure to the disk?
n200080 [17]
Formatting<span> writes the file system structure to the disk.</span>
8 0
2 years ago
A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the
Fynjy0 [20]

Answer:

# include <iostream.h>

# include <stdio.h>

# include <string.h>

using namespace std;

class citizen

{      

    int i;

    public string name[30];

    public long int phonenumber[30];

    public void addindividual(string name1)

     {      

           If (i<=30)

            {     int flag=0;

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

                  {

                     if (strcmp(name[i], name1)

                      {

                          flag=1;

                      }

                     else

                     {  

                           flag=0;

                     }

                  }

                  If (flag)

                 {

                  if (i<30)

                  {

                  for(j=i+1;j<=30; j++)

                  {

                        cout<<"Enter the name:"; getchar(name[j]);

                        cout<<"Enter the phone number:"; cin>>phonenumber[j];

                         i++;

                   }

                  else  

                   {

                        cout<<"The person already exists";

                        exit();

                   }

              }

            else

             {

                 cout<<"array is full:";

                 exit();

             }

     }

}

Void main()

{

     string str;

    cout<<" Enter name:";

    getline(cin, str); ;

     citizen c1=new citizen();

     c1.addindividual(name1);

}

Explanation:

With a little more effort you can make the program allow the user to enter any number of details, but less than 30 overall. We have used here flag, and as a programmer we know why we use the Flag. It is used to check whether certain Boolean condition is fulfilled or not. Here, we are checking whether a given name is present in the array of names, and if it is not present, we add that to the list. And if the name is present, we print, it already exist.

4 0
2 years ago
1. It is a requirement to install a routing protocol that monitors the network for routers that have changed their link state. T
Nady [450]

Answer:

1. Open Shortest Path First (OSPF)

2. Border Gateway Protocol (BGP)

3. Routing and Remote Access Service (RRAS)

4. Frame relay

5. Synchronous

6. Virtual

7. Committed Information Rate (CIR)

8. Integrated Services Digital Network (ISDN)

9. Asynchronous Transfer Mode (ATM)

10. Basic Rate Interface (BRI).

8 0
3 years ago
A slide _____ is a special animation effect used to progress from one slide to the next slide in a slide show.
Nutka1998 [239]
A slide *transition* is the word you're looking for, well I mean, if you're using powerpoint it is.
8 0
3 years ago
Read 2 more answers
What is the proper way to name the range of cells located in colum A row 3 through colum C row 7?
LenKa [72]

Answer:

it is C

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • The dlci field in the frame relay header is _________ bits long.
    14·1 answer
  • You are the manager and an employee shows up for his shift dressed inappropriately for work. What should you do?
    14·2 answers
  • A serialized object is ________. an object represented as a sequence of bytes used to store the object's data in a file an objec
    5·2 answers
  • Is a network where connected devices are located within the same building.
    5·2 answers
  • What is the cell membrane used for ​
    14·2 answers
  • Word documents contain how many sections by default?
    9·1 answer
  • Imagine a typical website that works as a storefront for a business, allowing customers to browse goods online, place orders, re
    13·1 answer
  • What will you see on the next line? &gt;&gt;&gt; int(6.5)
    12·2 answers
  • A program that will ring a bell six times is what kind of program?
    11·2 answers
  • If a work is in the public domain… Group of answer choices its copyright has expired. it may not be used for commercial purposes
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!