Skip to content

bpd01001/tip-calculator

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
css
 
 
 
 
js
 
 
 
 
 
 
 
 

Tip Calculator

An exercise in JavaScript function definitions and return values. Course: DMD 3475.

Introduction

Our tip calculator application is almost complete. Our function named updateValues() will fetch the values that were input by the user.

At that point, the values are passed as arguments to two functions named calculateTipPerPerson() and calculateTotalPerPerson(). The values that are returned by each function are used to update the DOM.

Instructions

  1. Define both required functions: calculateTipPerPerson() and calculateTotalPerPerson().
  2. Each function should accept the 3 arguments being passed to them within the updateValues() function.
  3. Using those values, calculate and return the appropriate answer.
  4. Extra credit: Properly round the dollars and cents that are returned by your functions.

Helpful Information

  • Search Google for "Tip Calculator" to see the desired functionality for this application.
  • The calculateTotalPerPerson() function should return a value that includes the tip.

About

Tip Calculator exercise for DMD 3475

Resources

Stars

Watchers

Forks

Releases

No releases published