Assignment 01

Due: Friday, Feb 1, 2019 at noon 50 pts.

For this assignment, you will type and submit three (3) algorithms. Make your algorithms clear and concise step-by-step procedures that solve the problems given. I think that each of these should require at least three steps and probably (though, possibly) no more than twenty steps. Think about your answers.

    1. You are to edit a single file in your DFS account using an editor (I like jpico) that your lab instructor has shown you in your CS 1580 lab #1( or #0 depending on who your lab instructor is). First though, make a new directory under your home directory and call it cs1570 (from home, type mkdir cs1570 and enter). Change into that directory (cd cs1570). Now, make a new directory under this cs1570 directory and name it hw1. Change into that directory and then create the file with your answers in it, naming it something clever like "hw1.txt". The .txt extension is used for files that are nothing but text (not to be compiled). What ever you name that file, make sure it has a .txt extension. This assignment is NOT C++ programming. You are not to compile this. In this (one and only) file (for this assignment), you are to number your answers for the following 3 problems. Also, be sure to put your name and section letter at the top!!You are driving down the highway. You run over a pair of scissors and the rear tire goes flat tire . (No, we don't care which one.) You have class in 30 minutes and must get there on time. In order to fix the flat yourself, you need a lug-wrench, a jack, and an inflated spare tire. If you don't have any one of these, you must call for help. Write a step-by-step description of how you are able to continue your drive. If you have never been shown how to repair a flat, have some one in the dorm show you. You never know when you might need this skill! Your algorithm should consider all possible situations of having the required tools and functional spare tire, and reflect safety concerns/practices one should employ when changing a tire.

      1. DO NOT look this up on the web. That would be cheesy.

  1. Write an algorithm to convert decimal numbers to binary. Whole numbers will suffice.

  2. You all learned how to add two fractions in grade school. Do you remember how? Can you teach someone else how? Thought so ... write an algorithm to instruct how to add two fractions. Of course, you will have to include an explanation of such terms as "least common multiple" or "greatest common divisor" if you use them.

To submit this homework, you are going to use the cssubmit program for your section of cs1570. This assignment will be used for all sections. Your answers should be written up using your favorite editer in a subdirectory called hw1 hanging off your cs1570 subdirectory. Remember: make a different directory under cs1570 for every one of your assignments. From that directory, at the UNIX command, type "cssubmit 1570 a 1" if you are in section a. If you are in section b, type "cssubmit 1570 b 1". If you are in section c, type "cssubmit 1570 c 1", etc. (Can you see the pattern?) Hit enter. Of course, when submitting homework #2, your last entry in that command should be a 2. Don't type cssubmit 1570 a h2 or some other variant like that; just the digit 2. Use this scheme for subsequent submissions. If you have any questions about using the editor or submitting, just ask. You can look here for guidance on submitting using the cssubmit command.

NOTE: You can submit the same assignments multiple times. If you submit and then remember something you forgot, you can edit your file, save it, then submit again. The new submission will overwrite the old; we won't see the old one. Time stamps on submissions apply to the latest submission. Always run the submit script from the directory in which the file(s) to be submitted reside(s). Any questions, just ask. Remember, there is a due date/time. Try not to exceed that.