Pseudo code or a flowchart of your program

Assignment Help Basic Computer Science
Reference no: EM132147908

List of fruits:

papaya

kiwifruit

zapote blanco

huckleberry

banana

fig

lime

xigua

vanilla

yiessas

tamarind

umkolo

quince

apple

imbu

elderberry

juneberry

mango

strawberry

nectarine

date

cherry

orange

watermelon

grape

raspberry

List above contains 26 fruits, each one with a name that begins with a different letter of the alphabet.

Make program named sort_fruits.py that reads in the fruits from the file unsorted_fruits.txt and writes them out in alphabetical order to a file named sorted_fruits.txt.

Incorporate the use of a list, for loop and / or while loop.

Create either pseudo code or a flowchart of your program. Your model must show how your program will read the input file, sort the entries and generate the output file.

In addition, you must submit both your program source code sort_fruits.py as well as the sorted file sorted_fruits.txt.

You can use the following fragment of code the open and read in the data from the unsorted_fruits.txt file. You will need to determine how to use a list structure to sort the items and how to write the data back out into the sorted_fruits.txt file.

infile = open("unsorted_fruits.tex", "r")

outfile=open("sorted_fruits.txt","w")

fruit=infile.read(50)

outfile.write(fruit)

print (fruit)

infile.close()

outfile.close()

In using this code fragment, once you have read a line from the file into the variable text, you must then determine how to load it into a list structure.

Reference no: EM132147908

Questions Cloud

Post an explanation of pathophysiology of diabetes mellitus : Post an explanation of the pathophysiology of diabetes mellitus and diabetes insipidus. Describe the differences and similarities between resulting alterations.
How changing weather patterns affect food production : Explain how changing weather patterns affect food production, the spread of disease, or damage to homes, transportation, or the electric grid.
Computers in a domain will have an account : Like users, computers in a domain will have an account established for them. Their account can be seen in AD Users and Computers and viewed or modified there
N-version programming approach : Describe some of the advantages and disadvantages of using the N-version programming approach.
Pseudo code or a flowchart of your program : List above contains 26 fruits, each one with a name that begins with a different letter of the alphabet.
Which characteristics or approaches demonstrated by person : Which characteristics or approaches demonstrated by this person would you integrate into your own leadership style? Which ones would you prefer not to integrate
What data management considerations : What data management considerations must be reviewed to ensure success for both companies and assure regulatory compliance
Identify the given with a high risk of falling : Falls are one of the major causes of mortality and morbidity in older adults. Every year, an estimated 30-40% of patients over the age of 65 will fall at least.
Code modified dijkstra algorithm to search from start node : Assignment - Dijkstra Algorithm - Your task is to Code the modified Dijkstra's algorithm to search from the start node out

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd