- 
                Notifications
    
You must be signed in to change notification settings  - Fork 10.2k
 
complete lab #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            nkp521
  wants to merge
  1
  commit into
  learn-co-curriculum:master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
nkp521:flow-lab
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    complete lab #25
Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| { | ||
| "stats": { | ||
| "suites": 4, | ||
| "tests": 9, | ||
| "passes": 9, | ||
| "pending": 0, | ||
| "failures": 0, | ||
| "start": "2025-05-05T18:39:07.720Z", | ||
| "end": "2025-05-05T18:39:07.830Z", | ||
| "duration": 110 | ||
| }, | ||
| "tests": [ | ||
| { | ||
| "title": "gives customers a free sample if the ride is less than or equal to 400 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() gives customers a free sample if the ride is less than or equal to 400 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "charges 20 dollars for a distance between 400 and 2000 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() charges 20 dollars for a distance between 400 and 2000 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "charges 30 dollars for a distance over 2000 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() charges 30 dollars for a distance over 2000 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "does not allow rides over 2500 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() does not allow rides over 2500 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "returns \"Ok, sounds good.\" when the city is NYC", | ||
| "fullTitle": "index.js ternaryCheckCity() returns \"Ok, sounds good.\" when the city is NYC", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"No go.\" if the destination city is not NYC", | ||
| "fullTitle": "index.js ternaryCheckCity() should return \"No go.\" if the destination city is not NYC", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"Thank you so much.\" if the tip is generous", | ||
| "fullTitle": "index.js switchOnCharmFromTip() should return \"Thank you so much.\" if the tip is generous", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"Thank you.\" if the tip is not as generous", | ||
| "fullTitle": "index.js switchOnCharmFromTip() should return \"Thank you.\" if the tip is not as generous", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"Bye.\" if anything else", | ||
| "fullTitle": "index.js switchOnCharmFromTip() should return \"Bye.\" if anything else", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| } | ||
| ], | ||
| "pending": [], | ||
| "failures": [], | ||
| "passes": [ | ||
| { | ||
| "title": "gives customers a free sample if the ride is less than or equal to 400 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() gives customers a free sample if the ride is less than or equal to 400 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "charges 20 dollars for a distance between 400 and 2000 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() charges 20 dollars for a distance between 400 and 2000 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "charges 30 dollars for a distance over 2000 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() charges 30 dollars for a distance over 2000 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "does not allow rides over 2500 feet", | ||
| "fullTitle": "index.js scuberGreetingForFeet() does not allow rides over 2500 feet", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "returns \"Ok, sounds good.\" when the city is NYC", | ||
| "fullTitle": "index.js ternaryCheckCity() returns \"Ok, sounds good.\" when the city is NYC", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"No go.\" if the destination city is not NYC", | ||
| "fullTitle": "index.js ternaryCheckCity() should return \"No go.\" if the destination city is not NYC", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"Thank you so much.\" if the tip is generous", | ||
| "fullTitle": "index.js switchOnCharmFromTip() should return \"Thank you so much.\" if the tip is generous", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"Thank you.\" if the tip is not as generous", | ||
| "fullTitle": "index.js switchOnCharmFromTip() should return \"Thank you.\" if the tip is not as generous", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| }, | ||
| { | ||
| "title": "should return \"Bye.\" if anything else", | ||
| "fullTitle": "index.js switchOnCharmFromTip() should return \"Bye.\" if anything else", | ||
| "duration": 0, | ||
| "currentRetry": 0, | ||
| "err": {} | ||
| } | ||
| ] | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,11 +1,34 @@ | ||
| function scuberGreetingForFeet(){ | ||
| // Write your code here! | ||
| function scuberGreetingForFeet(feet){ | ||
| if (feet <= 400){ | ||
| return 'This one is on me!' | ||
| } | ||
| else { | ||
| if (feet <= 2000){ | ||
| return 'That will be twenty bucks.' | ||
| } | ||
| else { | ||
| if (feet <= 2500){ | ||
| return 'I will gladly take your thirty bucks.' | ||
| } | ||
| else { | ||
| return 'No can do.' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| 
     | 
||
| function ternaryCheckCity(){ | ||
| // Write your code here! | ||
| function ternaryCheckCity(city){ | ||
| return city === "NYC" ? 'Ok, sounds good.' : 'No go.' | ||
| } | ||
| 
     | 
||
| function switchOnCharmFromTip(){ | ||
| // Write your code here! | ||
| function switchOnCharmFromTip(tip){ | ||
| switch (tip){ | ||
| case 'generous': | ||
| return 'Thank you so much.' | ||
| case 'not as generous': | ||
| return 'Thank you.' | ||
| default: | ||
| return 'Bye.' | ||
| } | ||
| 
     | 
||
| } | ||
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have extra time, trying giving this a refactor!