Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROJECT 2 Introduction The purpose of this project component is to provide a first experience in the actual writing of computer programs. Using a relatively

PROJECT 2
Introduction
The purpose of this project component is to provide a first experience in the actual writing of
computer programs. Using a relatively simple introductory scripting language (Python), you will
create program code in an editor (Notepad), save it to your disk, and run it from the command
line prompt.
You will gain experience in planning, writing, debugging, documenting, and running simple
programs. Learning Python serves as a convenient stepping-stone to more complex
object-oriented languages, such as Java.
In this project, you will use online resources, including downloadable Python tools and tutorials.
Before writing programs, it is useful to plan the programming steps and actions by writing an
algorithm. An algorithm is a set of plain English language commands or steps, each of which is
then replaced by the appropriate command line for the programming language used. This
technique becomes less useful when using complex object-oriented languages such as Java,
but may be helpful in the early stages of learning to design programs. You will write algorithms
for your first two programming exercises in this project.
The project will be graded for completeness and correct functioning of programs.
Acquiring the Tools
Download and install Python version 2.2 or higher by following the instructions at the Python
download site.
The downloaded file will be called Python-2_2.exe. After downloading, run this file to complete
the installation. You can view the installed components from your "Start" list.
Writing Algorithms
In the traditional approach to programming, the program is seen as a series of steps, which may
include branches and loops. A branch occurs when a program may go in two or more different
directions, depending upon a logical condition or a choice made by the user. A loop is a situation
where a particular step, or series of steps, may be repeated until a certain condition or choice
occurs.
The following simple example of an algorithm includes both elements, and describes a simple
program for performing addition or multiplication.
Step 1-display the program name "Addition and Multiplication"
Step 2-display the options menu "(A)dd,(M)ultiply"
Step 3-request and store input of user choice A or M as "choice"
Step 4-if "choice" does not equal "A" or "M", go to Step 9
Step 5-request and store the first number to be used as variable x
Step 6-request and store the second number to be used as variable Y
Step 7-if "choice" ="A" go to Step 11
Step 8-if "choice" ="M" go to Step 13
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

What is a global industry?

Answered: 1 week ago