Question

The first supreme court justice was appointed in 1789. Write a program to create a file...

The first supreme court justice was appointed in 1789. Write a program to create a file that lists the years from 1789 through 2015 in which no supreme court justices were appointed. The first four lines of the file will be 1792,1794,1795, and 1797.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Public Class Supremecourt

Private Sub btnJusticesAppointed_Click(sender As Object, e As EventArgs) Handles btnJusticesAppointed.Click

Dim justices() As String = IO.File.ReadAllLines("Justices.txt")

Dim possibleYears() As String = Array.CreateInstance(GetType(String), 0)

For i As Integer = 1789 To 2015

ReDim possibleYears(i)

possibleYears(i) = CStr(i)

Next

Dim queryYears = From year In justices

Let abbrev = year.Split(","c)(4)

Order By abbrev

Select abbrev

IO.File.WriteAllLines("NoAppointments.txt", possibleYears.Except(queryYears))

End Sub

End Class

Add a comment
Know the answer?
Add Answer to:
The first supreme court justice was appointed in 1789. Write a program to create a file...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Can you solve this in python. Thank you n Exercises 11 through 14, use the file...

    Can you solve this in python. Thank you n Exercises 11 through 14, use the file Justices.txt that contains data abou Supreme Court justices, past and present as of Janua 015. Each record of the file the state from which thy ry 2 contains six fields -first name, last name, appointing president, the state from which the were appointed, year appointed, and the year the justice left the court. (For current justices the last field is set to 0.) The...

  • Write a java program to create a student file which includes first name, last name, and...

    Write a java program to create a student file which includes first name, last name, and GPA. Write another Java program to open the students file. Display the students list and calculate the average GPA of the class.  

  • a] Read the New York Times article, “In Narrow Decision, Supreme Court Sides With Baker Who...

    a] Read the New York Times article, “In Narrow Decision, Supreme Court Sides With Baker Who Turned Away Couple” . Briefly summarize the case. b] Use as many specific concepts and contents from this course to develop your argument either in favor or against that Supreme Court ruling. c] Can you identify any direct and/or indirect violence associated with this conflict? Article: WASHINGTON — The Supreme Court on Monday ruled in favor of a Colorado baker who had refused to...

  • . The late Supreme Court Justice Antonin Scalia argued that because courts are not elected representative...

    . The late Supreme Court Justice Antonin Scalia argued that because courts are not elected representative bodies, they have no business determining certain cr4itical social issues. He wrote: Judges are selected precisely for their skill as lawyers; whether they reflect the policy views of a particular constituency is not (or should not be) relevant. Not surprisingly then, the Federal Judiciary is hardly a cross-section of America. Take, for example, this Court, which consists of only nine men and women, all...

  • 5. The late Supreme Court Justice Antonin Scalia argued that because courts are not elected representative...

    5. The late Supreme Court Justice Antonin Scalia argued that because courts are not elected representative bodies, they have no business determining certain critical social issues. He wrote: Judges are selected precisely for their skill as lawyers; whether they reflect the policy views of a particular constituency is not (or should not be) relevant. Not surprisingly then, the Federal Judiciary is hardly a cross-section of America. Take, for example, this Court, which consists of only nine men and women, all...

  • Using Python latest version. 4. File Name:  usernameListMe a. In this file, write the code to create...

    Using Python latest version. 4. File Name:  usernameListMe a. In this file, write the code to create a python list of strings that are 4 classes that are offered in the ICT program like "ict463" .   b. Then create a list of 4 classes that are Gen-ED courses like "math121". c. Write the code to concatenate the lists into a third variable.   d. Add a line of code to add one more Gen-ED course to the third - concatenated variable. e.Add...

  • Write a C++ program that reads text from a file and encrypts the file by adding...

    Write a C++ program that reads text from a file and encrypts the file by adding 6 to the ASCII value of each character. See section 5.11 in Starting out with C++ for information on reading and writing to text files. Your program should: 1. Read the provided plain.txt file one line at a time. Because this file has spaces, use getline (see section 3.8). 2. Change each character of the string by adding 6 to it. 3. Write the...

  • Create a Java program that analyzes a program and produces the output into another file. The...

    Create a Java program that analyzes a program and produces the output into another file. The program must retrieve the path to the .java file. Once the path to the file is found the program must figure out the length of the longest line is in the program. For example, working with a program called MainFile.java. Once it figures out the longest line in the code it will put the output into MainFile.java.stats and it will be located in the...

  • Write a program in Java that reads the file and does two things: Write to an...

    Write a program in Java that reads the file and does two things: Write to an output file called dataSwitch.txt the same data from the input file, but switch the order of the data entries on each line. For example, if the first line of the input file is “90001 57110”, the first line of the output file would be “57110 90001”. Additionally, print to the screen the number of lines in the file with a label

  • Teen Court is a juvenile diversion program designed to circumvent the formal processing of first-time juvenile...

    Teen Court is a juvenile diversion program designed to circumvent the formal processing of first-time juvenile offenders within the juvenile justice system. An article reported on a study in which offenders were randomly assigned either to Teen Court or to the traditional Department of Juvenile Services method of processing. Of the 58 Teen Court individuals, 16 subsequently recidivated during the 18-month follow-up period, whereas 12 of the 51 Department of Juvenile Services individuals did so. Does the data suggest that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT