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
Lerok [7]
4 years ago
6

Write a basic program that performs simple file and mathematical operations.

Computers and Technology
1 answer:
Ostrovityanka [42]4 years ago
7 0

Answer:

Explanation:

I have written the Python program based on your requirements.

Just give the path of the input file and the path for the output file correctly where you want to place the output file.

In, my code - I have given my computer's path to the input and output file.

You just change the path correctly

My code works perfectly and I have tested the code with your inputs.

It gives the exact output that you need.

I have attached the Output that I got by running the below program.

Code:

month_list={ "january":"1","february":"2", "march":"3","april":"4", "may":"5", "june":"6","july":"7", "august":"8", "september":"9","october":"10", "november":"11", "december":"12"} input_file=open('C:\\Users\\Desktop\\inputDates.txt', 'r') output_file=open('C:\\Users\\Desktop\\parsedDates.txt','w') for each in input_file: if each!="-1": lis=each.split() if len (lis) >=3: month=lis [0] day=lis[1] year=lis [2] if month.lower() in month_list: comma=day[-1] if comma==',': day=day[:len (day)-1] month_number=month_list[month.lower()] ans-month_number+"/"+day+"/"+year output_file.write (ans) output_file.write("\n") output_file.close() input_file.close()

- O X parsedDates - Notepad File Edit Format View Help 3/1/1990 12/13/2003

- X inputDates - Notepad File Edit Format View Help March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1

cheers i hope this helped !!

You might be interested in
Which three of the following statements are true about using a WYSIWYG editor?
lubasha [3.4K]

Answer:

3

Explanation:

3 0
3 years ago
Read 2 more answers
Hypertext Markup language (HTML) version _____ added support for style sheets to give web designers greater control over page la
Ipatiy [6.2K]

Answer:

4.01 version .

Explanation:

A hypertext Markup language is used for designing the web page when we added the CSS on the web page we can create the web page more efficient manner and also there is more control over the web page because we can easily call the classes of CSS.

The Hypertext Markup language version 4.01 provides greater flexibility on the web page also We can also control the page layout in a very easy manner. The appearance of the web page is good as compared to version HTML 4

8 0
4 years ago
Briefly describe the concept of network topology change and explain how these can be dealt with using Routing Information Protoc
Natasha2012 [34]

Answer: network topology is the arrangement of nodes which includes routers and switches so that enables connection between the server and the client.

however due to times when there is huge traffic in the nodes there needs to be an optimal path for the exchange of information which is accomplished by different routing protocols.

Explanation:

Routing Information Protocol(RIP) is one such protocol which enables to route packets from the source to the destination having the least possible traffic along its path. There are two sets of routing algorithm which are

1. Static routing protocols

2. Dynamic routing protocols.

The difference between the two is that dynamic routing protocols helps to construct the routing tables dynamically as compared to static routing.

RIP is a type of dynamic routing whereby it sends the contents of its routing table the adjacent routers every 30 seconds and whenever a route is discarded from the routing table it is marked as unusable.

RIp is supported by almost all routers and also supports load balancing which is one of it advantages.

8 0
3 years ago
How to do assignment 5 on edhesive
s2008m [1.1K]

Answer:

//To pass in a string, and pass in a pivot string, and at that moment print in obligatory sequence, the string after pivot string till last as first string, and published beforehand the left slice of string.

import java.util.Scanner;

public class Main {

public static void main(String args[]) {

  Scanner s2 = new Scanner(System.in);

  System.out.println("Enter the parent String:");

  String f2 = s2.nextLine();

  System.out.println("Enter pivot(child string):");

  String piv1 = s2.nextLine();

  int start2 = f2.indexOf(piv1);

  int end2 = piv1.length()+start2;

  if (start2 == -1){

    System.out.println("Error: child string(Pivot) not discovered.");

    return;

}

String first2 = f2.substring(0,start2-1);

  String second2 = f2.substring(end2);

if (f2.charAt(start2-1)==' '){

System.out.println(second2 + " " + piv1 + " " + first2);

return;

}

System.out.println(second2 + piv1 + first2);

}

}

Explanation:

Please check the answer section.

6 0
3 years ago
_____ consists of the instructions that direct the operation of the computer system and enable users to perform specific tasks,
kaheart [24]

Answer:

Software

Explanation:

6 0
3 years ago
Other questions:
  • If you want to conserve ink or toner, you can instruct PowerPoint to print ____ documents.
    10·1 answer
  • Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of
    10·1 answer
  • What hernia repair codes can be reported with add-on code 49568?
    6·1 answer
  • Which of the following resources can be used by an OS to communicate with hardware? (Select 2)
    11·1 answer
  • Need help:(!!!! I’ll mark brainliest if correct
    5·1 answer
  • I need help 50 points and brainiest if you answer
    10·2 answers
  • Someone, please help me w/ king.com
    10·1 answer
  • Suppose you are developing a cricket game in which you are asked to enter score of every ball and can score maximum 6 on each ba
    15·1 answer
  • Get ready to be the Quizmaster! You are going to design your own Python game show in the style of a quiz.
    13·1 answer
  • 22. Write the following in full un computer
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!