Previous: 1.5 Exercises
Up: 1 Introduction
Previous Page: 1.5 Exercises
- Develop an algorithm for the calculation of the value of each stock and the
total value of a portfolio of stocks. Draw a structural diagram and write the
algorithm using constructions used in the text.
- Develop an algorithm for calculating and printing the squares of a set of
numbers. Draw a structural diagram, a flow chart, and write the algorithm.
- Develop an algorithm for calculation of the grade point ratio for each
student, i.e., (total grade points) / (total credit hours). Each student earns
grades (0-4) in a set of courses, each course with different credit hours
(1-3). Grade points in one course are given by the product of the grade and the
credit hours for the course. Draw a structural diagram and a flow chart.
- Assume that an ``add'' operator is available, but not a ``multiply'' operator
in a programming language. Develop an algorithm that will multiply two positive
integers using only the ``add'' operator.
- Assume that you are only able to read the numeric value of each successive
digits of a decimal integer one digit at a time.
The objective is to find the overall numeric value of the number.
As each new digit is read, the overall numeric equivalent must be updated to
allow for the new digit.
For example, if the digits read are 3,2, and 5, the result printed should
be 325.
Extend the algorithm for a number in any specified base.
-
Log in to the computer system available to you.
Practice using the text editor available by entering the following
simple program and storing it in a file:
main()
{
printf("hello world\n");
}
- Compile the program you entered in Problem 6.
Note which file have been created during compilation.
Execute the compiled program.
- Explore the computer you will be using.
See what applications may be available to you
such as electronic mail, and news.
Previous: 1.5 Exercises
Up: 1 Introduction
Previous Page: 1.5 Exercises