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

Write a Perl program to accomplish each of the following on the file solar.txt (see link at the class homepage) 1. Print all rec

ords that do not list a discoverer in the eighth field. 2. Print every record after erasing the second field. Note: It would be better to say "print every record" omitting the second field. 3. Print the records for satellites that have negative orbital periods. (A negative orbital period simply means that the satellite orbits in a counterclockwise direction.) 4. Print the data for the objects discovered by the Voyager2 space probe. 5. Print each record with the orbital period given in seconds rather than day
Computers and Technology
1 answer:
ryzh [129]3 years ago
8 0

Answer:

see explaination

Explanation:

use strict;

use warnings;

my $filename = 'data.txt';

open(my $fh, '<:encoding(UTF-8)', $filename)

or die "Could not open file '$filename' $!";

while (my $row = <$fh>) { //Q1

chomp $row;

atfields = split(/:/, $row);

if($fields[7] eq "?" || $fields[7] eq NULL)

print "$row\n";

}

while (my $row = <$fh>) { //Q2

chomp $row;

atfields = split(/:/, $row);

print '$fields: ' , replace($fields[1],"",$fields[1]) , "\n";}

}

while (my $row = <$fh>) { //Q3

chomp $row;

atfields = split(/:/, $row);

if (index($fields[2], "-") != -1) { //Looking out for negative sign in the field

print "$row\n";

}

while (my $row = <$fh>) { //Q4

chomp $row;

atfields = split(/:/, $row);

if($fields[7] eq "Voyager2")

print "$row\n";

}

Note: replace at anywhere in the program with the at symbol

You might be interested in
Best practices and trends for technology integration
cluponka [151]

Answer:

Technology use must be aligned to the standards. Technology must be integrated into daily learning,

Explanation:

Technology use must be aligned to the standards. Technology must be integrated into daily learning, not used as an add-on to instruction to match personal learning needs. Students need opportunities to use technology collaboratively. Technology must support project based learning and include real-world simulations.

3 0
3 years ago
Access your Practice Lab titles Access your exercise content Reports and files Access your settings Access help and support Comp
Degger [83]

Answer:

The extension for a shell script in windows ends with a .ps1 and for the extension for linux it is .sh, not quite sure for OSX.

4 0
3 years ago
The type of power that has the ability to call on connections and networks both inside and outside the organization for support
givi [52]

Answer: c) Connection power

Explanation:

Connection power is the power that is established personally in the field of business.A person having connection with powerful person personally outside or inside the organizational field then he/she can attain the desired goals or result through connecting with them, influencing powerful person's decision, getting their things done etc .

  • Other options are incorrect because association power, information power,coercive power and referent power are the power to establish connection organization to achieved aim.
  • Thus, the correct option is option(c)
5 0
3 years ago
All of the following are examples of what rigorous coursework in high school might mean except: A) added reading assignments. B)
faust18 [17]

Answer:b

Explanation:

3 0
4 years ago
Read 2 more answers
Write a program that calculates the average rainfall for three months. The program should ask the user to enter the name of each
sergeinik [125]

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // string array

   string m[3];

   // array to store rainfall

   double rainfall[3];

   // variables

   double avg_rainfall,sum=0;

   

   for(int i=0;i<3;i++)

   {

       cout<<"Enter name of month "<<i+1<<" :";

       // read month name

       cin>>m[i];

       cout<<"Enter rainfall (inches)  in month "<<i+1<<" :";

       // read rainfall

       cin>>rainfall[i];

       // sum of rainfall

       sum+=rainfall[i];

   }

   // Average rainfall

   avg_rainfall=sum/3;

   // print Average rainfall

   cout<<"Average rainfall for "<<m[0]<<","<<m[1]<<","<<m[2]<<" is "<<avg_rainfall<<" inches."<<endl;

return 0;

}

Explanation:

Create string array "m" to store name of month and double array "rainfall" to store rainfall. Read name of 3 months and rainfall in that month.Find the sum of all the rainfall  and the average rainfall.Print the average rainfall of 3 months.

Output:

Enter rainfall (inches)  in month 2 :45                                                                                    

Enter name of month 3 :july                                                                                                

Enter rainfall (inches)  in month 3 :43                                                                                    

Average rainfall for may,june,july is 42.6667 inches.

4 0
3 years ago
Other questions:
  • MATLAB graphics user interface:<br> Describe what Folder, Command Window and Workspace are.
    5·1 answer
  • What career is likely to have to highest salary
    14·2 answers
  • Which is used on both computers and mobile devices, is the second oldest browser?
    14·1 answer
  • What does Josh Silverman name as the most important aspect of managing finances?
    10·2 answers
  • A small graphic that you click on to perform a function in a software program is called a _____.
    15·1 answer
  • Assignment Guidelines
    12·1 answer
  • D) Software which is basically language translation software.​
    11·1 answer
  • Determine the number of character comparisons made by the brute-force algorithm in searching for the pattern GANDHI in the text
    7·1 answer
  • Digital security measures include _____. Select 2 options.
    11·2 answers
  • HELP PLSS!?? I’ve been stuck on this one for a while because I mess up too many time ! If you can solve this than I’ll give you
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!