Week_1 - johnelwart/Projects GitHub Wiki

Home

Homework 1: Some Good Songs

Description: This is a variation of a "Hello World" program. In this one, the program prints out a song title, the artist, and a link to it on Spotify as a recommendation for our professors playlist

Input(s): None

Output(s): The title, artist, and link of the recommended song

Source Code

Homework 2: Cable Installation Revenue

Description: This program calculates the revenue after installing cables at a user defined number of locations. The program charges $25 per location plus $2 for each foot of cable to calculate the revenue.

Input(s):

  • The number of locations cable is installed
  • The amount of cable installed in yards

Output(s): The total revenue earned

Source Code

Homework 3: Gravitational Force

Description: This program uses Newtons Universal Law of Gravitation to calculate the force between two bodies in Dynes.

Input(s):

  • Mass of body 1
  • Mass of body 2
  • Distance between the two bodies

Output(s): The calculated force

Source Code

Homework 4: Landscape Design

Description: This program calculates how much area the grass and concrete part of a garden. The grass area is calculated first by multiplying the result of subtracting 4 times the width of the sidewalks from the width and the result of subtracting 3 times the width of the sidewalks from the height value.

Input(s):

  • Garden width
  • Garden length
  • Sidewalk width

Output(s):

  • Area of the concrete part
  • Area of the grass part

Source Code

Homework 5: Elapsed Time

Description: This program takes two 24 hour time inputs from the user and calculates the elapsed time using integer division and modulus operator. It assumes the second time is later than the first time.

Input(s):

  • Time one hour value
  • Time one minute value
  • Time one second value
  • Time two hour value
  • Time two minute value
  • Time two second value

Output(s): The elapsed time calculated by the program.

Source Code

Lab 1: Driving Calculations

Description: This program calculates the average speed using a distance and time value from the user and using the Distance = Rate * Time formula to calculate the average speed.

Input(s):

  • Driving distance
  • Driving time

Output(s): The average speed calculated by the program

Source Code