answer.
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]
2 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]2 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
Question 1:State the values of a, b, c, d and e after the following operations are carried out:
pychu [463]

Answer:

1.

a = 1

b = 20(int). 20,2857143(double)

c = 39

d = 7.6

e = 456

2.

x = 98

y = 99

z = 97

w = ca

print(x,y,z,w) -> 98 99 97 ca

3.

x = Please

y = walk on the gras

Pleasewalk on the gras

Explanation:

you can use IDE/Interpreter python to get clue number 3 and number 2

Sorry for bad English.

5 0
2 years ago
Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). O
babymother [125]

Answer:

The program to this question can be given as:

Program:

#include <iostream> //header file

using namespace std; //using namespace

double MphAndMinutesToMiles(double milesPerHour, double minutesTraveled) //defining method

{

return (minutesTraveled/ 60.0)*milesPerHour; //return value.

}

int main() //defining main method

{

double milesPerHour,minutesTraveled; //define variable

cout<<"Enter miles per hour :";  

cin >> milesPerHour;  

cout<<"Enter travelling minutes :";

cin >> minutesTraveled;

cout << "Miles: "<< MphAndMinutesToMiles(milesPerHour, minutesTraveled)<< endl;

return 0;

}

Output:

Enter miles per hour :12

Enter travelling minutes :20

Miles: 4

Explanation:

The explanation of the above C++ program can be given as:

  • In the first header file is include the function is define that is "MphAndMinutesToMiles". This function accepts two parameters that are "milesPerHour and minutesTraveled".
  • Both parameter datatype is double and the function return type is also double. Inside a function calculate miles and return its value.
  • In the main method, two variable defines that takes value from the user side and pass into the function. To print function return value we use "cout" function that prints function return value.
6 0
2 years ago
If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
Basile [38]

Answer:

I think it’s slide shorter view

Explanation:

6 0
2 years ago
In which of the following stages of the development process is a team MOST likely to interview a potential user of an app?
Sedaia [141]

Answer:

Its c

Explanation:

5 0
2 years ago
Which company has experienced censorship in China?
MariettaO [177]
Google experienced censorship in china. :) 
5 0
2 years ago
Read 2 more answers
Other questions:
  • Exercise 6.3 consider memory storage of a 32-bit word stored at memory word 42 in a byte-addressable memory. (a) what is the byt
    14·1 answer
  • Phillip is a wellness counselor. He has created a newsletter as a service for his clients. He needs to decide upon a method to d
    7·1 answer
  • The development of the original personal computer (PC) was a(n) __________ innovation at the time, whereas adding a different ki
    8·1 answer
  • A technician is troubleshooting a small network with cable Internet service in which a user is receiving a message in her web br
    15·1 answer
  • LensForAll is a company that sells affordable contact lenses on its website. The CEO of the company realizes that an app must be
    9·1 answer
  • Consider the following 3-PARTITION problem. Given integers a1; : : : ; an, we want to determine whether it is possible to partit
    10·1 answer
  • Using virtualization comes with many advantages, one of them being performance. Which of these is NOT another realistic advantag
    7·1 answer
  • Select the correct answer. Andy wants to become a multimedia producer. Which degree can help him achieve this goal? A. bachelor’
    5·1 answer
  • Which of the following is true of how the Internet has responded to the increasing number of devices now using the network? a) T
    12·2 answers
  • A colleague sent you an awesome article about using proper ergonomics while sitting at the computer. You don't have time to read
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!