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
QveST [7]
3 years ago
8

Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o

f a search range. The file should be read using the file.readlines() method. The input file contains a list of alphabetical, ten-letter strings, each on a separate line. Your program should output all strings from the list that are within that range (inclusive of the bounds). Ex: If the input is: input1.txt ammoniated millennium and the contents of input1.txt are: aspiration classified federation graduation millennium philosophy quadratics transcript wilderness zoologists the output is: aspiration classified federation graduation millennium
Computers and Technology
1 answer:
xxTIMURxx [149]3 years ago
3 0

Answer:

Python code explained below

Explanation:

f = open(input())

#loading the file, which will serve as the input

s1 = input()  

s2 = input()

lines = f.readlines()

for line in lines:

   line = line.strip(

# strip() removes characters from both left and right

   if s1 <= line <= s2:  #setting the range

       print(line)

f.close()

#closing the file

You might be interested in
What was the #1 song in 1987 and who was the artist
Veronika [31]
Billboard magazine said it was "Walk Like an Egyptian" by The Bangles.
8 0
3 years ago
Read 2 more answers
What is network topology​
Fynjy0 [20]
DescriptionNetwork topology is the arrangement of the elements of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, including command and control radio networks, industrial fieldbusses and computer networks.
3 0
3 years ago
Write an application for Cody’s Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery
Firdavs [7]

An application for Cody’s Car Care:

#include <iostream>

#include <string>

#include <vector>

using namespace std;

int main()

{

vector<string>stroptions(4);

stroptions[0] = "Oil Change";

stroptions[1] = "Tire Rotation";

stroptions[2] = "Battery Check";

stroptions[3] = "Brake Inspection";

 

vector<int> intprices(4);

intprices[0] = 45;

intprices[1] = 22;

intprices[2] = 15;

intprices[3] = 10;

 

int option;

cout<< "Welcome to Joe's Car Care Shop!" <<endl;

cout<< "Choose a service from our menu:" <<endl;

for(int i = 1; i<= 4; i++)

{

  cout<< "#" <<i<< ": " <<stroptions[i-1] <<endl;

}

cout<< "Choice: ";

bool loop = true;

while(loop)

{

  loop = false;

  cin>> option;

 switch(option)

  {

   case 1:

     cout<< "\nA " <<stroptions[option-1] << " will be: $" <<intprices[option -1] <<endl;

     break;

   case 2:  

     cout<< "\nA " <<stroptions[option -1] << " will be: $" <<intprices[option -1] <<endl;

     break;

   case 3:

     cout<< "\nA " <<stroptions[option -1] << " will be: $" <<intprices[option -1] <<endl;

     break;

   case 4:

     cout<< "\nA " <<stroptions[option -1] <<" will be: $" << intprices[option -1] <<endl;

      break;

    default:

     cout<< "\nYou entered an invalid item! Try again!" <<endl;

     loop = true;

     break;

 }

}

}

3 0
3 years ago
All of the following are types of goals listed in the course except?
zloy xaker [14]
A. Financial, because the rest seem to be health related.
4 0
3 years ago
Read 2 more answers
Discuss the advantages and disadvantages of using a USB or parallel port dongle for licensing purposes.
Dafna11 [192]

An advantage is portability A disavantage is loseability An advantage is faster read and write speeds(most of the time) a disavantge is less storage

4 0
3 years ago
Read 2 more answers
Other questions:
  • The protocol that enables computers on the Internet to communicate with each other is called _____.
    7·1 answer
  • On laptops with a smart card reader installed, where is the smart card reader usually located?
    5·1 answer
  • Which of the following describes ETL? a) A process that transforms information using a common set of enterprise definitions b) A
    14·1 answer
  • Describe how electrons move between atoms to create electricity.
    7·2 answers
  • The main workspace of a Windows computer is called the______
    5·1 answer
  • What is your understanding about the subject “digital image processing”?
    14·1 answer
  • What is the principal goal of data science?<br>​
    5·1 answer
  • __________(fill in the blank) in online education refer(s) to how online education impacts students of a specific economic group
    15·1 answer
  • What are the main differences between openldap and microsoft's active directory (ad)? check all that apply
    13·1 answer
  • The objective fuction of linear progrmming should be
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!