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
Zepler [3.9K]
3 years ago
10

Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not

following that format is incorrect and should be ignored. Use the substring() method to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990.
Ex: If the input is:

March 1, 1990
April 2 1995
7/15/20
December 13, 2003
-1
then the output is:

3/1/1990
12/13/2003
Computers and Technology
1 answer:
Airida [17]3 years ago
3 0

Answer:

Explanation:

The following code uses the requested method and while loop in order to continue asking the user for inputs until the -1 input is passed and the program ends, outputting the correct format dates. Due to technical difficulties I had to add the code as a txt file attached below. The picture below shows the output of the code as requested using the test inputs provided.

Download txt
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
ec9086bcbf2547784f036fbb9d68eba1.jpg
You might be interested in
Given the code that reads a list of integers, complete the number_guess() function, which should choose a random number between
Cerrena [4.2K]

Answer:

see explaination

Explanation:

import random

def number_guess(num):

n = random.randint(1, 100)

if num < n:

print(num, "is too low. Random number was " + str(n) + ".")

elif num > n:

print(num, "is too high. Random number was " + str(n) + ".")

else:

print(num, "is correct!")

if __name__ == '__main__':

# Use the seed 900 to get the same pseudo random numbers every time

random.seed(900)

# Convert the string tokens into integers

user_input = input()

tokens = user_input.split()

for token in tokens:

num = int(token)

number_guess(num)

5 0
3 years ago
Source ________ contains instructions written by a programmer specifying the actions to be performed by computer software.
konstantin123 [22]

Source code contains instructions written by a programmer specifying the actions to be performed by computer softwa

7 0
2 years ago
Computer programming
Svet_ta [14]
Sjanqknjwolq esjkalqlkd
5 0
3 years ago
Computer-generated color images of the brain that provide information about brain activity and glucose metabolism are produced b
frozen [14]

The answer to this question is the PET scan. Positron Emission Tomography or PET scan is an imaging test that checks and trace for diseases in the body. This also shows how the body organs is functioning / working. The doctor can evaluate the function of the patients body by the 3D color images produced by the PET Scan.  

4 0
3 years ago
Help me plz What character must always be used when a formula is enter in a cell? (on a spreadsheet)​
lara [203]

Answer:

The equal sign "=" must be used.

Most, if not all, spreadsheet programs support formulas, but you must start them with an equal sign.

8 0
3 years ago
Other questions:
  • 1. JAVA Create one method to do the following expressions. Given the following declarations, what is the result of each of the e
    13·1 answer
  • Can someone please help??
    12·1 answer
  • Which of the following is a list of input devices?
    11·1 answer
  • What is commodity? explain
    14·1 answer
  • I need to write a really simple python program to solve this issue. I have most of the program written but, when I run the secon
    8·1 answer
  • For your biology class, you have taken a number of measurements for a plant growth experiment. You wish to create a chart that s
    10·1 answer
  • Which term collectively describes hard disks, CDs, and flash drives?
    11·2 answers
  • In black and white,<br><br> we must be more conscious of image
    11·1 answer
  • Which of these are examples of a bug?
    6·1 answer
  • Can someone help me with python
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!