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
Help please! Coding!
gladu [14]

Answer:

Explanation:

16

17

5 0
3 years ago
1. What conversion factor should be used to convert from Gigaliters to liters?
Ilia_Sergeevich [38]
The conversion factor is 10 to the 9th power
5 0
3 years ago
A computer is a multipurpose device that accepts input processes data and produces output all according to a series of stored
yulyashka [42]
According to a series of stored procedures 
8 0
3 years ago
Point: A Point in a two dimensional plane has an integer x coordinate value and an integer y coordinate value.
UNO [17]

Answer:

They are connected

Explanation:

8 0
3 years ago
Define Based Assessment ​
Oduvanchick [21]

Explanation:

In an educational setting, standards-based assessment is assessment that relies on the evaluation of student understanding with respect to agreed-upon standards, also known as "outcomes". The standards set the criteria for the successful demonstration of the understanding of a concept or skill -WIKIPEDIA

8 0
3 years ago
Other questions:
  • Anti-bullying laws in most states are designed to provide
    14·2 answers
  • USB keys can store terabytes of data. Of the five key factors that contribute to the increasing vulnerability of organizational
    13·1 answer
  • Three uses for Auto Formatting in Word 2016.
    5·1 answer
  • lance measured 0.485 liter of water. Angel measured 0.5 liter of water. lance said, "My beaker has more water than yours because
    6·2 answers
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • Most network behavior analysis system sensors can be deployed in __________ mode only, using the same connection methods as netw
    8·1 answer
  • What is a geam in the ggplot2 system?
    5·1 answer
  • IN EXCEL, File, menu , edit, insert are all located in ?
    7·1 answer
  • Computer is a major source of informarion why​
    8·1 answer
  • Physical and data link layer standards govern transmission in ________. LANs WANs Both LANs and WANs Neither LANs nor WANs
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!