CS 104 - Lab 1
Due in Blackboard Assignment (one file named lastnameLab1.txt) Week 2 before
Lab (8:35am)
Objectives:
Tasks:
1. (20 points) Break a basic problem down into inputs, process and ouputs and write pseudocode to solve the problem. NO MATLAB CODE IS NEEDED
Answer the following questions for the problems listed below. Type your answers in a text file.:
Problems:
A. A teenager gets retained by a neighborhood association to distribute fliers, collect dues, and do miscellaneous chores. Just to make sure he is around when needed, he gets 40 dollars a month (he doesn't have to work for that). Plus he gets $11.25 per hour for any time he actually works in a month. Calculate how much the teenager earns if he works H hours in a month.
B. | Consider the 3 dimensional barbell shown. a) Find the volume of the figure if the radius of each sphere is given, and the length of the bar connecting them is given, and the diameter of the bar is given (all in the same units) b) Find the surface area of the figure. |
C. Most stop watches allow you to display the time elapsed as a number of seconds, or as hours:minutes: seconds. So 5437 seconds or 1 hour:30 minutes:37 seconds Given an integer number of seconds, calculate the equivalent integer number of hours, integer number of minutes, and integer number of seconds.
D. A person suffering from type II diabetes injects insulin based on measurements of their blood sugar level. If the blood sugar level is less than 115, they don't need to inject any insulin at all. For a value of 115, they inject 1 unit of insulin. For every additional increase of 20 in her blood sugar level, they get one additional unit of insulin. (Thus, for a blood-sugar level of 134, they get 1 unit; for a blood-sugar level of 135, they get 2 units.) Create a formula for calculating the insulin injections and output a table that shows the number of units of insulin injected for a user input range of blood sugar values from 115 upwards.
E. The UN publishes a list of countries and the life expectancy in each country. http://www.cs.iit.edu/~cs104/labs/Lab1/lifeExpectancy.xls Column 1 is country and column 2 is life expectancy. Find the average life expectancy.
Copyright CS, Illinois Institute of Technology