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
lesya [120]
3 years ago
10

Make a program that prints each line of its input that mentions fred. (It shouldn’t do anything for other lines of input.) Does

it match if your input string is Fred, frederick, or Alfred? Make a small text file with a few lines mentioning "fred flintstone" and his friends, then use that file as input to this program and the ones later in this section.
Computers and Technology
1 answer:
Vitek1552 [10]3 years ago
8 0

Answer:

See Explaination

Explanation:

This assume that input is a file and is given on command line. Please note this will ot print lines with frederick as thats what I feel question is asking for

#!/usr/bin/perl -w

open(FILE, $ARGV[0]) or die("Could not open the file $ARGV[0]");

while ($line = <FILE>){

if($line=~/\s+fred\s+/)

{

print $line;

}

}

close(FILE);

You might be interested in
Bob is having no luck performing a penetration test on Retail Store's network. He is running the test from home and has download
Novosadov [1.4K]

Incomplete question. The full question read;

Why is Jim having these problems?

Options:

A. Security scanners are not designed to do testing through a firewall.

B. Security scanners cannot perform vulnerability linkage.

C. Security scanners are only as smart as their database and cannot find unpublished vulnerabilities.

D. All of the above.

Answer:

<u>D. All of the above.</u>

Explanation:

<em>Remember, </em><u>security scanners</u> are only designed to <em>gather</em> information about a network, but not with the ability to perform firewall testing. Also, these security scanners are pre-programmed with existing vulnerabilities in their database, and so it would impossible to discover vulnerabilities on the Retail store's network.

Hence, since Bob is using the wrong tools, he is unsuccessful in performing a penetration test.

3 0
3 years ago
Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the g
I am Lyosha [343]

Answer:

#program in Python.

#function to calculate driving cost

def driving_cost(d_miles, m_per_gallon, doll_per_gallon):

   #calculate cost and return the value

   return (d_miles / m_per_gallon) * doll_per_gallon

#read the miles per gallon  

m_per_gallon = float(input("Enter car's miles/gallon:"))

#read dollars per gallon

doll_per_gallon = float(input("Enter gas dollars/gallon:"))

#call function to find cost for 10 miles

print('%0.2f' % driving_cost(10, m_per_gallon, doll_per_gallon))

#call function to find cost for 50 miles

print('%0.2f' % driving_cost(50, m_per_gallon, doll_per_gallon))

#call function to find cost for 400 miles

print('%0.2f' % driving_cost(400, m_per_gallon, doll_per_gallon))

Explanation:

Read the value of miles per gallon and assign it to variable "m_per_gallon". Then read dollars per gallon from user and assign it to variable "doll_per_gallon". Call the function driving_cost() with parameter miles, m_per_gallon and doll_per_gallon. This function will find the cost of driving and return the cost.Call function for  10, 50 and 400 miles.

Output:

Enter car's miles/gallon:20                                                                                                

Enter gas dollars/gallon:3.1599                                                                                            

1.58                                                                                                                      

7.90                                                                                                                      

63.20

5 0
3 years ago
Read 2 more answers
The Windows ____ window allows you to create the graphical user interface for your application.
DerKrebs [107]

The Windows GUI window allows you to create the graphical user interface for your application.

8 0
3 years ago
Question #8
White raven [17]

Answer:

The other person is correct the answer is 7

Explanation:

I got it right on edge

3 0
3 years ago
Approximately how many user accounts were affected by a 2013 hack of the yahoo technology company, which it just announced this
torisob [31]
About one billion user accounts were affected
3 0
4 years ago
Other questions:
  • A. STOP: What is a technology habit you practice today that you now realize will not help you to be successful? Explain why it’s
    10·2 answers
  • Two columns of a relational table can have the same names. <br> a. True <br> b. False
    15·1 answer
  • Your health insurance company gives you a discount if you wear a fitness-tracking bracelet. After wearing it for a few months, y
    5·1 answer
  • Why do generated backup scripts usually include backticks around names such as database names and column names?
    5·1 answer
  • How much memory did the first smartphone have?
    11·1 answer
  • How much heat is needed to raise the temperature of 7g of water by 15oC?
    6·1 answer
  • Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to
    12·1 answer
  • Which is better Play Station Xbox or PC
    14·2 answers
  • In the Business world people are often measured by their???
    14·1 answer
  • A program that converts a program to binary all at once and runs the entire program when finished with the conversion
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!