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
Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable.
notsponge [240]

Answer:

Following are the statement in the c++ language

ifstream inFile;  // declared a variable inFile

ofstream outFile; //declared a variable outFile

Explanation:

The  ifstream and ofstream  is the file stream object in the c++ Programming language .The ifstream file stream object is used for reading the contents from the file whereas the ofstream  file stream object is used for writting the contents into the file.

  • We can create the variable for the ifstream and ofstream These variable is used for reading and writing into the File.
  • Following are the syntax to create the ifstream variable and ofstream variable

        ifstream variablename;

        ofstream  variablename

7 0
3 years ago
Leo needs to consolidate data in multiple worksheets by performing a calculation across all worksheets on the same cells.
wolverine [178]
A do you think is the answer
4 0
3 years ago
Read 2 more answers
Write the statement that includes a friend function named before in the class dateType that takes as parameters two objects of t
Lerok [7]

Answer:

In opp friend function is a function that gives the same access to private and protected data. It is declared in class that is granting access.

Explanation:

#include<iostream.h>

using namespace std;

class Sum

{

 int a, b, add;

 public:

 void input()  

{

 cout << "Enter the value of l and m:";

 cin >> l>>m;     taking input from users

}

 friend void add(sum &t);

 void display()  

{

  cout << "The sum is :" << z;

}

};

 void add(sum & p)  

{

  p.add = p.a + p.b;

}

 int main()  

{

  sum p1;

  p1.input();

  add(p1);

  p1.display();

  return false;  

if(display==5)  

{

 return true;  //true is returned if sum is equal to 5

}

else        //if they are not the same

{

 return false;

}

}

8 0
3 years ago
Where can I watch jersey shore for free <br> Pls don’t say soap2day, any apps or something?
poizon [28]

Answer:

maybe try Y o u t u b e

Explanation:

sometimes they have full episodes of shoes on there for free

3 0
3 years ago
What does mtu stand for
Nataliya [291]
Michigan technological University
8 0
3 years ago
Read 2 more answers
Other questions:
  • A toolkit is:
    15·1 answer
  • What will the following code display? #include using namespace std; void doSomething(int); int main() { int x{2}; cout &lt;&lt;
    9·1 answer
  • By including ______
    15·2 answers
  • What is the small window that pops up in a application that requieres a response for the user
    12·2 answers
  • An example of a ______ in the United States are computer hackers, whose members engage in actions that subvert authority, disrup
    6·1 answer
  • Online transaction processing (OLTP) and online analytical processing (OLAP) are similar MIS strategies used to help with busine
    9·1 answer
  • True / False<br> General purpose registers can be read and written by ML programs
    10·1 answer
  • Bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào
    15·1 answer
  • <img src="https://tex.z-dn.net/?f=%28a%20%2B%20b%29%20%20%7B2%7D" id="TexFormula1" title="(a + b) {2}" alt="(a + b) {2}" align
    15·1 answer
  • You want to connect an external hard drive for backups. Which is the fastest connection used by current external hard drives
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!