Skip to content

diehl-cs/algorithms-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chapter 1 Algorithms

This code demonstrates the following three algorithms.

Car Cost

Given the following, compute the total cost for two cars and find the cheapest.

  • annual fuel consumed = annual miles driven / fuel efficiency
  • annual fuel cost = price per gallon * annual fuel consumed
  • operating cost = 10 * annual fuel cost
  • total cost = purchase price + operating cost

Doubling Money

Algorithmically compute how many years it will take to double any given amount of money with any given annual interest percentage.

Phone Bill

Under a plan that costs $29.95 per month for 300 minutes of calls, plus $0.45 for every minute over 300, plus 12.5% in taxes and interest fees, calculate the phone bill for a month having used any given number of minutes.

About

Demonstration of the algorithms from Chapter 1.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages