Previous: 1.5 Exercises
Up: 1 Introduction
Previous Page: 1.5 Exercises

1.6 Problems

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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");
    	}

  7. Compile the program you entered in Problem 6. Note which file have been created during compilation. Execute the compiled program.

  8. 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

tep@wiliki.eng.hawaii.edu
Mon Aug 15 11:23:22 HST 1994