Computer Programing and Solving

Description

You have to read the book and answer the question and do the programming challange 2

Don't use plagiarized sources. Get Your Custom Assignment on
Computer Programing and Solving
From as Little as $13/Page

Unformatted Attachment Preview

Introduction to Java
Computer Programming and
Problem Solving
Second Edition
Chris Simber
Assistant Professor, Computer Science
Rowan College at Burlington County
Cataloging Data
Names: Simber, Chris, author.
Title: Introduction to Java: Computer Programming and Problem Solving
Subjects: Java (Computer Programming Language)
Chris Simber
Assistant Professor of Computer Science
Rowan College at Burlington County
Author contact: [email protected]
Introduction to Java: Computer Programming and Problem Solving by
Christopher Simber is licensed under a Creative Commons Attribution –
NonCommercial-ShareAlike 4.0 International License, except where
otherwise noted. Images may not be distributed individually.
All screenshots included on the basis of Fair Use.
Creative Commons — Attribution-NonCommercial-ShareAlike 4.0 International — CC BYNC-SA 4.0
Under the following terms: Attribution — You must give appropriate credit, provide
a link to the license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor endorses you or
your use.
creativecommons.org
Introduction
This book is intended for use in an introductory course in programming using
the Java programming language, and includes content for students who are not
familiar with programming. The book introduces general computer information
and basic computer operations, as well as software engineering principles and
processes used in industry to implement computer-based solutions. Algorithm
development and problem-solving techniques are introduced as well.
The Eclipse integrated development environment (IDE) is utilized and
instructions to obtain, install, and “Getting Started in Eclipse” are provided in
the appendices. The goal is to provide students with an overview of computers,
software engineering tools and techniques, and to introduce them to computer
programming in Java quickly for hands-on instruction.
The examples and exercises reinforce the material being introduced while
building on previous material covered, and follow the programming standards
for Java publicized by the World Wide Web Consortium (W3C) and set forth in
the Java Coding Guidelines created by Joe McManus MGR at Carnegie Mellon
University, Software Engineering Institute. Appendix G provides an adequate
abridgement of programming standards. The in-chapter exercises are numbered
for clarity using a shaded box, and can be used as in-class exercises or as
assignments.
The Java version in use at the time of this writing is Version 8. The Integrated
Development Environment (IDE) selected is Eclipse which is free to download
and use. The Eclipse interface has the common look and feel associated with
most integrated development environments and is used extensively in industry.
Instructions for obtaining and installing Eclipse are provided in Appendix B,
including resolving the most common JRE and JDK issues.
Getting started in Eclipse is provided in Appendix C with a sample start-up
program. Links to the Eclipse web site, Java Tutorials, and the Java Coding
Guidelines are included in Appendix F which also includes a link to the Java
Tutorial at the W3Schools website.
There are end-of-chapter assignments, and an answer key, exams, and
accompanying lecture slides are available.
Acknowledgements:
Rowan College at Burlington County Student Feedback
Revision History:
First Edition: August 2022
Second Edition: January 2023
Changes to the Second Edition include minor rewording, corrections to
typographical errors, and an additional assignment (#2B) in chapter 2.
Contents
Chapter 1
Computers and Programming
1
Chapter 2
Java Language Basics
19
Chapter 3
Decision Structures and Boolean Logic
53
Chapter 4
Loops and Repetition Structures
81
Chapter 5
Methods, Modules, and Basic Graphics
111
Chapter 6
Arrays and ArrayLists
139
Chapter 7
File Operations and Exceptions
167
Chapter 8
Classes and Objects
191
Chapter 9
Inheritance and Interfaces
227
Chapter 10
Graphical User Interfaces
253
Chapter 11
GUI Programs
289
Chapter 12
Technology and Society
318
Appendix A
ASCII Character Set (partial list)
Appendix B
Obtaining and Installing Eclipse
Appendix C
Getting Started with Eclipse
Appendix D
Modular Programming
Appendix E
Creating and Input Data File
Appendix F
Helpful Links to Information
Appendix G
Java Programming Style and Standards
Appendix H Multiple Panels and Layout Managers Example
“Five minutes of design time, will save hours of programming” –
Chris Simber
1
Chapter 1
Computers and Programming
Computers are simply data processing devices. They are machines that receive
input, process it in some way, and produce output. Computer programs are
made up of a series of statements that tell a computer what to do and in what
order to do it.
These programs provide a sequence of small steps for the
computer to execute and produce the desired result. Millions or even billions of
these small steps are being executed by the computer as we run programs. This
may seem odd to the casual computer user, but these small steps combine to
provide what appear to be seamless operations as we interact with the computer.
Computer programs are referred to as software and they are needed to make
the computer useful. People who design, write, and test software are commonly
referred to as software engineers, software developers, or computer
programmers. To better understand the computing process and programming in
general, a familiarity with the parts that make up a computer is necessary.
The Central Processing Unit (CPU)
Any part of the computer that we can physically touch (including inside the
casing) is referred to as hardware. One important piece of hardware is the
Central Processing Unit CPU which is the “Brains” of the computer. The CPU
performs millions of basic instructions per second and controls computer
operations. The CPU has two parts. The Arithmetic Logic Unit (ALU) handles
Chapter 1 Computers and Programming
2
basic arithmetic and comparisons of data such as less than, greater than,
equivalent, and not equivalent. The Control Unit retrieves and decodes program
instructions and coordinates activities within the computer.
Brown and Green Computer Processor Pixabay is licensed under CC0
Figure 1.1 – Central Processing Unit (CPU)
The CPU (shown upside down above) has pins that plug into a socket located on
a circuit board called the motherboard.
Main Memory
RAM stands for Random Access Memory and is often referred to as main
memory. RAM is a series of memory chips on a circuit board installed in the
computer on the motherboard along with the CPU. The memory in these chips
contains a series of memory addresses that enable the computer to store and
locate information.
These memory addresses are volatile and when the
computer is turned off, RAM does not retain information. It is erased. When a
program is launched, the program is copied into RAM for the CPU to use.
RAM by Headup222 is licensed under Pixabay License
Figure 1.2 – Laptop Main Memory (RAM)
The CPU can access instructions and data from RAM very quickly, and RAM is
located close to the CPU on the motherboard. The RAM circuit card for a laptop
Chapter 1 Computers and Programming
3
computer is shown above.
The large rectangles are the memory chips, the
notches are an aid for inserting the RAM into position on the motherboard, and
the gold edge makes the connections for data access. Since RAM is erased when
the computer is turned off, secondary storage is used to retain information.
Read Only Memory or ROM contains the startup instructions for the computer
including the BIOS or Basic Input Output System. It is non-volatile and retains
information between sessions.
Secondary Storage
Secondary storage devices are non-volatile and the information stored is not
erased when the power is off. Secondary storage devices include the hard drive
inside the computer, external drives connected to the computer, and flash drives.
The hard drive inside the computer may be a disk drive which houses a rotating
disk and data access arm (shown below), or a solid-state drive which has no
moving parts and operates faster than a traditional disk drive.
Laptop-hard-drive-exposed by Evan Amos is licensed under CC BY-SA 3.0
Figure 1.3 – Hard Drive (cover removed)
External drives are typically solid-state and connect to the computer through a
cable plugged into a USB (Universal Serial Bus) connector, or plug directly into
the USB port of the computer as in the case of flash drives. Flash drives use flash
memory, and do not have a disk drive.
Chapter 1 Computers and Programming
4
Input and Output Devices
Input devices are anything that provides input or data for a computer.
Common input devices are the keyboard, mouse, microphone, and camera.
Output devices include anything that accepts computer output such as
monitors, speakers, and printers.
Since data files located on storage devices can be used for reading data into a
computer or writing output from a computer, they could be considered both
input and output devices.
Software
Computers are machines that follow an input, processing, output sequence of
operations and need to be told what to do and in what order to do it. This is
accomplished through sets of instructions called software. There are essentially
two types of software: system software (Operating Systems), and application
programs (all other software).
The operating system (OS) provides an interface for us to use computers more
easily. Initially command line interfaces were used, followed by menu driven
interfaces, and then the Graphical User Interface (GUI) was introduced and has
been used since. Most operating systems provide a Graphical User Interface that
is now commonly used to interact with the computer. It acts like an orchestra
conductor by controlling computer hardware, managing devices connected to
the computer, and interacting with programs that are running.
Operating
systems commonly in use today are Windows, macOS, and Linux.
Application software includes the computer programs that we commonly use to
accomplish work such as word processors, spreadsheet programs, collaboration
tools, and audio/video editing tools, as well as gaming software.
The Language of Computers
The language of computers is a binary language consisting of ones and zeros.
This is the beauty and simplicity of the computer. At the basic level, everything
is a 1 or a 0, is either On or Off, Yes or No, True or False. The bit, or binary digit
Chapter 1 Computers and Programming
5
used in computing represents a logical state that can be 0 or 1. It is the smallest
information representation in a computer.
A Byte is 8 bits consisting of a
combination of 0s and 1s, and in computers, each letter, number, and special
character consists of a binary representation. For example, a lower case “f” is
represented in binary as 01100110 in accordance with the ASCII standard
(pronounced askee).
ASCII stands for the American Standard Code for
Information Interchange which was developed as a character encoding standard.
The ASCII table consists of 256 binary representations for the 26 uppercase and
26 lowercase letters, and the 9 digits, as well as special characters, punctuation
marks, and other symbols and keyboard keys. Appendix A provides a partial list
of the binary and decimal representations for the upper and lowercase letters,
digits, and punctuation. A portion is shown here with the decimal equivalent.
ASCII Table (excerpt)
The Unicode standard incorporates the 256 item ASCII standard and expands to
include the binary representations for symbols and characters for most of the
world’s languages. Unicode 13.0 contains representations for 143,859 characters.
Instructions for the computer must be in its’ language including numbers that
are stored or used in computations. Numeric integers (whole numbers) are
represented in computers using the positions of the bits and powers of 2 starting
from right and working left.
Binary Number Bit Representations
Chapter 1 Computers and Programming
6
As an example, the number 90 would be represented in binary as 01011010. Each
bit is either 0 or 1 and is multiplied by the power of 2 at its position. The results
are then added together.
0
0 x 27
1
0
1
+ 1 x 26 + 0 x 25 +
1
0
1
0
1 x 24 + 1 x 23 + 0 x 22 + 1 x 21 + 0 X 20
(0 x 128) + (1 x 64) + (0 x 32) + (1 x 16) + (1 x 8) + (0 x 4) + (0 x 2) + (0 x 1)
0
+
64
+
0
+
16
+
8
+
0
+
2
+
0
= 90
Binary Number Conversion
The limit to the numbers that can be stored using 8 bits is 255 with all 8 bits being
1’s. To store larger numbers, two Bytes would be used with a combination of
sixteen 1’s and 0’s. That would allow storing numbers as large as 65535. To store
larger numbers, more Bytes could be used. To store negative numbers and
floating-point numbers (numbers with a decimal or fractional part), other
numbering schemes are used such as the two’s complement and floating-point
notation.
Images (which are made up of pixels) are stored by converting each pixel to a
numeric value which is then stored in binary. Sound is stored using samples that
are converted to the nearest numeric value.
Programming Languages
Although the computers’ language, referred to as machine language, is a binary
language, it would be tedious for us to write instructions for computers in
Binary. Machine language is one of the two languages commonly referred to as
low-level languages for computers, the other being Assembly language.
Assembly language consists of very basic instructions like move a value into
memory, add another value to that one, and store the result in memory. An
assembler is used to convert Assembly language programs into executable
machine code. Both of these low-level languages mirror the operations of the
CPU in simplicity and basic operations.
Chapter 1 Computers and Programming
7
The CPU goes through what is called a machine cycle in which it performs the
same series of simple steps: fetch, decode, execute, and store. The instructions
executed during a machine cycle are very simple, but billions of instructions can
be processed per second.
CPU Machine Cycle
1. fetch the required piece of data or instruction from memory
2. decode the instruction
3. execute the instruction
4. store the result of the instruction
CPU Machine Cycle
The processing power of a CPU is dependent upon the number of instructions
that the CPU can execute per second, and is measured in hertz (cycles-persecond). This is often referred to as the CPU clock-speed. This does not refer to a
wall clock, but the computer’s clock or the internal timing of the computer. A
one-gigahertz (1 GHz) CPU can execute one billion cycles (instructions) per
second, and the clock-speed would be one-gigahertz.
Writing software (programming) in a low-level language is possible, but high-
level languages provide a much easier way. As more software was written,
high-level languages were introduced to make programming easier and more
efficient.
In high-level languages, multiple instructions are combined into a
single statement. There are hundreds of high-level languages (700+) that have
been developed. Today there are approximately 250 high-level programming
languages in use by programmers. Some of these are used extensively, others
not so much. Each language was created for a purpose and has benefits and
limitations as well as a following, proponents, and detractors.
The following is a short list of some popular high-level languages and their
intended uses.
Chapter 1 Computers and Programming
8
BASIC
Beginners All-purpose Symbolic Instruction Code
C, C++
powerful general-purpose programming
COBOL
Common Business-Oriented Language – business programs
FORTRAN
FORmula TRANslator for math and science
Pascal
teaching programming
Java
applications running over the internet
JavaScript Web site operations (not related to Java)
PHP
web server applications and dynamic web pages
Python
general-purpose applications and data handling
Popular High-level Programming Languages
Writing software in any of these languages is much easier than the low-level
languages of Machine and Assembly, but the computer is still only interested in
machine language. To translate programs written in a high-level language to the
machine language for the computer, compilers and interpreters are used.
A compiler translates the high-level language into a separate machine language
program.
Software engineers refer to this as compiling or “building” the
program. A “Build” is a compiled version of the software and the program can
then be run whenever needed because it is a stand-alone executable program.
Java uses a compiler.
An interpreter on the other hand, reads, translates, and executes the program
one line at a time. As an instruction in the program is read by the interpreter, it
converts the instruction into machine language and then executes that one
instruction. The Python programming language is an interpretive language and
uses an interpreter to execute the instructions.
The instructions (programs) written by programmers are referred to as source
code, which is written using a text editor in an Integrated Development
Environment (IDE). IDEs are software applications that include integrated
tools for software developers to write, execute, and test software. There are
many IDEs available, but they are very similar in the way that they look, are
used, and operate.
Chapter 1 Computers and Programming
9
Developing Software
There are specific phases in the process of developing software that provide for
the development of accurate, maintainable, and scalable software, that meets
project or program requirements. These phases include design, development,
test and integration, and delivery and maintenance. But before any work can
begin, a complete understanding of what the program is supposed to do is
required. This is derived from the project or program requirements.
Requirements
The requirements for a computer program detail what the program is supposed
perform. How it will do what it is supposed to do will be determined as the
design phase is completed during the software development phase (SDP).
Requirements Decomposition is the act of discovering in detail from the
requirements what the program is required to accomplish. As requirements are
reviewed, additional information may be needed and questions may arise. It is
important to determine the specifics before moving forward. This process also
assists in decomposing the project into manageable “chunks” in terms of the
schedule and team assignments for development. Once the requirements are
thoroughly understood, the software development lifecycle begins.
Software Development Life Cycle (SDLC)
The Software Development Life Cycle includes the steps necessary to design,
develop, deliver, and maintain the computer program. The phases follow one
another and are often accomplished by different team members with
collaboration as questions and issues arise. As an example, a software developer
may meet with a design engineer to clarify information in the design, or a Test
Team member may contact a software developer regarding test results.
Software Development Lifecycle
Chapter 1 Computers and Programming
10
Design
As the requirements are decomposed and documented, the design phase begins,
and the break-down of required tasks and logical steps in the program are
developed. Design is a very important part of the software development life
cycle due to the increased costs of making changes or fixing errors later in the
process (errors in code are referred to as bugs). The sooner an issue is resolved,
the less rework and testing of the code are needed. This is highlighted in the
chart below from the IBM Systems Sciences Institute.
Cost of Fixing Errors by Phase
Software engineering tools that assist in the design (and development stage as
well) include pseudocode (sort of code). Pseudocode is a short-hand version of
the order of operations for a program. Consider a requirement for a program
that obtains age and salary information from a user, computes Recommended
Net Worth, and displays the result. The pseudocode for the solution might be:
Step 1
Start the program
Step 2
Obtain the age and salary information
Step 3
Compute the RNW (age x salary divided / 10)
Step 4
Display the output
Step 5
End the program
Pseudocode
Chapter 1 Computers and Programming
11
A flowchart often provides a clearer representation of the algorithm (logical
steps to the solution). Various geometric shapes are used to indicate different
operations (shapes may vary depending on industry). The order of operations is
typically top down, and lines with arrows are used to indicate the order or flow
of control.
Flowcharts can ensure that steps in the process haven’t been
overlooked and that there is a complete understanding of the operational flow of
the program. They can also be used to assist programmers when developing a
complex part of a program.
Example Flowchart
A flowchart can be a simple sketch or developed using a flowcharting
application such as LucidChart or SmartDraw. Flowcharts are often required
to be delivered to a development team or subcontractor together with specific
requirements for the code, and are often required in customer documentation.
Many software engineers use a combination of tools. Pseudocode may be used
for a high-level description of the program or a program area, and a flowchart
might be used for more complex sections. Either way, the goal is to have a
comprehensive understanding of the requirements at every level to ensure that
the final product meets the requirements and is as error-free as possible.
Chapter 1 Computers and Programming
12
Development
Once a design is complete (or nearly complete since some aspects of the solution
may not be knowable during design), the development phase begins.
The
development phase includes writing the code that will be executed to produce
the desired result and meet the requirements. Most often, the development of a
program is divided among multiple programmers and requires collaboration
and regular discussion to ensure a cohesive solution.
To manage software
development projects and enable multiple people to work on the same program
at the same time, a Configuration Management System (CMS) is used with a
source code repository that stores and maintains all of the program files.
Software Development Collaboration
Programmers access this repository to obtain a copy of a file containing the
source code to add functionality or make modifications. The code is written in
the copy of the file, and this changed file is tested with the other files in the
source code repository.
After testing, the modified file is placed into the
repository and is used by all of the other programmers in place of the original
file. The original file is retained by the configuration management tool as a
version control mechanism.
If a new file needs to be created, it is created in the configuration management
tool and added to the source code repository. CMS tools facilitate collaborative
Chapter 1 Computers and Programming
13
development, and version control of the files and the overall project. Many
industries and customers require their use.
Many configuration management systems have integrated suites that include:
scheduling and tracking, task assignment, defect reporting, and issue tracking
systems. In addition, tools for software teams and software project managers are
commonly used in industry to plan and measure project progress, and to provide
visibility into the design, schedule status, cost, and quality of the code.
Software Development Processes
For the software development phase, the Agile Development Process is a
popular method in use today. Agile processes go by various names (a few listed
below), but all are iterative and incremental software methodologies.
This
process of developing portions of the software and adding them to the overall
project incrementally is commonly referred to as Iterative Enhancement.
Common Agile Methodologies

Scrum – regular meetings, with periodic cycles called sprints

Crystal – methodology, techniques, and policies

Dynamic Systems Development Method (DSDM)

Extreme Programming (XP)

Lean Development

Feature-Driven Development (FDD)
Agile Software Development Methodologies
A key component of the Agile Development Process is the sprint (the
development period between status meetings). Sprint status meetings (scrums)
are review and planning events that occur regularly. Tasks completed from the
previous sprint plan are reviewed, and completed work is demonstrated to
stakeholders for feedback and approval. The tasks that were not completed from
the previous sprint plan are reviewed with a course of action (re-plan) for the
next development cycle. The scope of new work that will be completed during
the next sprint cycle is planned, and engineers are assigned to the tasks.
Chapter 1 Computers and Programming
14
The phases in the Agile Development Process include: Plan, Design, Develop,
Test, and Evaluate, and are repeated during each sprint. Once delivered, the
project would be in the maintenance phase.
Agile Development Process Phases
Another software development methodology is the Waterfall model which
uses similar phases, but they are sequential, and are non-repeating. Each phase
depends on the completion of the previous phase, although there may be some
overlap. The Waterfall model was used extensively in the past, and is still
common in some industries today. The maintenance phase follows the delivery
of the software and includes updates.
Waterfall Development Process Phases
Chapter 1 Computers and Programming
15
Test and Integration
As development is completed, the next phase in the software development life
cycle is test and integration. In the initial test phase, the programmer runs the
program to ensure that there are no errors in the code, and that it performs
correctly (meets the requirements). In large organizations, a test team or test
engineer will also run the program and report any errors found to the developer
for correction. On large-scale programs, a formal Test and Integration Team
would be responsible for this phase and would run a variety of tests including:
Unit Tests on the modules (portions of code being added or modified), and an
Integration Test which verifies that the parts of the program work well together
when the new code is integrated into the overall project. Adding the new or
modified code into the program may introduce new errors which must be
corrected. Regression testing compares new test results with previous results
and ensures that the program functions correctly.
Types of Errors
The three types of errors that are looked for during the test phase are syntax
errors, logic errors, and runtime errors.
Syntax errors have to do with violating language specific rules like indentation
and punctuation and are found by the compiler or interpreter and the code will
not execute. The programmer must correct these and most IDEs will highlight
them as an aid in development.
Logic errors are errors in the algorithm or the way that the algorithm was
written by the programmer. For example, if the requirement is that the program
multiply a number by two only if it is greater than ten, and the programmer
writes the code so that a number is multiplied by two if it is less than ten, that
would be a logic error.
The program compiles and runs, but it produces
incorrect results.
Runtime errors are logic errors that cause the program to stop executing. An
example would be a part of the program attempting to divide a number by zero.
Most IDEs will provide a Traceback of the sequence causing the error. Runtime
errors can be avoided by thoroughly designing and testing the algorithm.
Chapter 1 Computers and Programming
16
Delivery and Maintenance
The final phase of the software development life cycle is the delivery and
maintenance phase. In this phase, the program is delivered to the client or
customer and a period of maintaining the program begins. Maintenance of a
program would include updates that fix errors or security issues found after
initial delivery, or upgrades that provide additional functionality or capability.
Updates to software programs are commonplace today.
Ergonomics
The set-up or arrangement of the computer and furniture to minimize the risk of
injury or discomfort is a field of engineering called ergonomics. It includes the
study of the physical effects of repetitive motion and working in a stationary
position for an extended period. As more people spent their days working at
computers, a variety of health issues surfaced. Some guidelines include:

Monitor position – with respect to eye level (dry eyes)


Adjustable chair – arm posture (tennis elbow)


Elbows should be at 90-degree angles
Proper posture – back posture (lumbar issues)


Eyes should be looking slightly downward
Lumbar support and back straight
Taking periodic breaks – eye strain, posture, repetitive motion

20-20-20 rule says every 20 minutes look 20 feet way for 20
seconds


Standing or walking away for few minutes
Adequate lighting – eye strain

Dark areas and dark backgrounds cause eye strain
Ergonomic Guidelines
Chapter 1 Computers and Programming
17
Chapter 1 Review Questions
1. Computers are simply _________ __________ devices.
2. The physical parts of the computer are referred to as _____________.
3. The CPU is considered the ___________ of the computer.
4. The CPU performs basic ____________ and controls computer _________.
5. Main memory (RAM) is ________ and is erased when a computer is turned off.
6. __________ Storage device memory is non-volatile and is retained when the
power is turned off.
7. A computer keyboard, mouse, and camera are examples of _________ devices.
8. Computer monitors, speakers, and printers are examples of __________devices.
9. Sets of programmed instructions for a computer are referred to as __________.
10. _____________ and _____________ are the two basic types of software.
11. The language of computers is a _________ language.
12. The smallest information representation in computing is a _____ or binary digit.
13. A binary digit can have a logical state of _____ or _____.
14. A Byte is a combination of ________ bits that are either one or zero.
15. The number represented by 0110 1001 is _______.
16. The binary representation of the number 255 is ___________.
17. The names of the two low-level languages are __________ and __________.
18. A Machine cycle consists of ________, ________, ________, and ________.
19. A 2 GHz (gigahertz) processor can execute __________ instructions per second.
20. High-level languages make programming a computer _____ and more _______.
21. Java is a _______ -level language.
22. A (n) ___________ translates a high-level language into a separate machine
language program.
23. A (n) ___________ reads, translates, and executes a program one line at a time.
24. The four steps in the Software Development Life Cycle are ________,
____________, _______________, and _________________.
25. The costs associated with fixing errors in code are __________ when caught
early in the process.
Chapter 1 Computers and Programming
18
26. A written shorthand version of the steps to complete a task in a computer
program is called _______________.
27. The act of discerning in detail from the requirements what the program is to
accomplish is called ___________________ ____________________.
28. A set of logical steps taken to complete a task is called a(n) _____________.
29. Plan, design, develop, test, and evaluate are the five steps in the ___________
development process.
30. The three types of programming errors are _________, __________ and
____________ errors.
Chapter 1 Short Answer Exercises
31. Explain the major difference between main memory and secondary storage.
32. List at least three (3) input devices.
33. List at least three (3) output devices.
34. List the two (2) types of software.
35. Write the word Java using the binary representations of the letters.
36. Write the binary representation for the number 176.
37. List the two low-level languages.
38. What is the purpose of a source code repository?
39. List the five phases of the Agile Development cycle.
40. Explain the difference between logic and syntax errors.
Chapter 1 Programming Exercises
41. Write the pseudocode for the steps required to determine the total
price for some number of items entered by the user priced at $9.00
each with a 7% sales tax.
42. Draw a flowchart of the steps in Programming Exercise 1 above.
43. Ensure that you have access to a cop