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
Write a class called (d) Teacher that has just a main method. The main method should construct a GradeBook for a class with two
podryga [215]

Answer:

The java program is given below.

import java.util.*;

class GradeBook  

{

//variables to hold all the given values

static int m11, m12, m13;

static int m21, m22, m23;

static String name1, name2;

//variables to hold the computed values

static double avg1, avg2;

//constructor initializing the variables with the given values

GradeBook()

{

name1 = "Jack";

m11 = 33;

m12 = 55;

m13 = 77;

name2 = "Jill";

m21 = 99;

m22 = 66;

m23 = 33;

}

//method to compute and display the student having highest average grade

static void computeAvg()

{

avg1=(m11+m12+m13)/3;

avg2=(m21+m22+m23)/3;

if(avg1>avg2)

System.out.println("Student with highest average is "+ name1);

else

System.out.println("Student with highest average is "+ name2);

}  

}

//contains only main() method

public class Teacher{  

public static void main(String[] args)

{

//object created

GradeBook ob = new GradeBook();

//object used to call the method

ob.computeAvg();

}

}

OUTPUT

Student with highest average is Jill

Explanation:

1. The class GradeBook declares all the required variables as static with appropriate data types, integer for grades and double for average grade.

2. Inside the constructor, the given values are assigned to the variables.

3. The method, computeAvg(), computes the average grade of both the students. The student having highest average grade is displayed using System.out.println() method.

4. Inside the class, Teacher, the main() method only has 2 lines of code.

5. The object of the class GradeBook is created.

6. The object is used to call the method, computeAvg(), which displays the message on the screen.

7. All the methods are also declared static except the constructor. The constructor cannot have any return type nor any access specifier.

8. The program does not takes any user input.

9. The program can be executed with different values of grades and names of the students.

8 0
3 years ago
What is the<br> binary code<br> for<br> "DMS"?
koban [17]

Answer:

D= 01000100

M= 01101101

S= 01110011

Explanation:

7 0
3 years ago
What is the most likely result of making a plan for life after high school
lilavasa [31]

Answer:

It is nice to have somewhat of an outline regarding what you would like to do after high school, however, I believe it may be more difficult to have a whole plan.

Explanation:

There is no way anyone can predict what can happen so not everything will go to plan. As humans we learn to alter our choices to the situation we are in so a certain event in your life could take place causing you to take a completely different route than the one you had intended or planned.

8 0
3 years ago
Examples of pop in computer​
marishachu [46]

Answer:

Short for Post Office Protocol, POP or POP mail is one of the most commonly used protocols used to receive e-mail on many e-mail clients. There are two different versions of POP: POP2 and POP3. POP2was an early standard of POP that was only capable of receiving e-mail and required SMTP to send e-mail. POP3 is the latest standard and can send and receive e-mail only using POP, but can also be used to receive e-mail and then use SMTP to send e-mail.

3 0
2 years ago
Suppose that you want to write a program that inputs customer data and displays a summary of the number of customers who owe mor
Allushta [10]

Answer:

The correct option is D = regionNumber

Explanation:

In this scenario we want to know customers who owe more than $1000 each, in each of 12 sales regions. And the customer data variables include name, zip-code, balanceDue and regionNumber; based on the customer data variables names and zip-code will not really affect our output. It is based on balanceDue that we increment the number of customer owing in a particular region (regionNumber).

Therefore, we would add 1 to an array element whose subscript would be represented by regionNumber since we are interested to know the number of customer owing in each of the 12 sales regions.

3 0
3 years ago
Other questions:
  • Which cloud computing service model gives software developers access to multiple operating systems for testing?
    5·1 answer
  • HURRY
    5·1 answer
  • What was the ENIAC computer and how was it used/what for?
    9·1 answer
  • TRUE OR FALSE! HELP!!
    13·1 answer
  • An interface is a class that contains only the method headings and each method heading is terminated with a semicolon. True Fals
    7·1 answer
  • What is the TAG to begin a Web page, as recommended by the W3C?
    13·1 answer
  • Write a function called printBackwards() that will work with a C string. The function will print any C string backwards. You don
    13·1 answer
  • Is it important for a writer to include voice and point of view in writing because...<br> Plz help
    10·1 answer
  • Irene wants to connect your smart phone wirelessly to her laptop in order to transfer images. which two images could she reasona
    15·1 answer
  • In the Create Sparkline dialog, the _______ box refers to the cell range where you want the Sparklines to appear.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!