Question

Write a program in JavaScript that determine the daily fee for renting a car from Miller’s...

Write a program in JavaScript that determine the daily fee for renting a car from Miller’s Car Rental which normally charges $55 (as an example) for a “necessity” car. However, there is an additional charge for renting luxury car. The additional charge depends on whether the customer belongs to Miller’s Rental Club. It is $20 for the club member and $30 for non-members.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

code:

function dailyRentalFee(carType,isMember){
basePrice = 55
memberCharges = 20
nonMemberCharges = 30
//check if car type is necessity or luxury
if(carType === 'necessity'){
return basePrice;
}else if(carType === 'luxury'){
//check if he is a member of millers rental club
if(isMember){
return basePrice+memberCharges;
}else{
return basePrice+nonMemberCharges;
}
}else{
return 0;
}
}

Add a comment
Know the answer?
Add Answer to:
Write a program in JavaScript that determine the daily fee for renting a car from Miller’s...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Car Rental Management System The aim of this project is to design and implement a computerized...

    Car Rental Management System The aim of this project is to design and implement a computerized Car Rental Management System for a company called COEN244Cars. The company rents two types of cars: standard and luxury cars. A car is identified by a car identification number (int), a type (string), and a flag that indicates whether the car is currently available or not. The company distinguishes between three types of customers: regular customers, corporate customers, and VIPs (Very Important Persons). A...

  • Write a C++ program that asks for the following information about a book order from the...

    Write a C++ program that asks for the following information about a book order from the console: • Title • Author • ISBN (hint: careful about what data type to use - validate 9 or 13 characters) • Price (validate number < 400) • Quantity (number of books to purchase – validate > 0 and < 100) • Fiction/Non-Fiction (‘N’ or ‘F’ - validate) • Genre (‘R’ romance, ‘D’ drama, ‘M’ mystery – validate) Make use of the following data...

  • please write program in java and comment the code clearly. I am providing previous classes Media...

    please write program in java and comment the code clearly. I am providing previous classes Media and payment codes to be used for this class.(its not a big code to write , it seems ,because i added previous classes , pleases help. public class Media { String name; int year;    // a constructor which initializes the media with the provided name and publication year. public Media(String name, int year) { this.name = name; this.year = year; }    //...

  • What's Next? Will sharing replace owning? In much of the United States and Europe customers have...

    What's Next? Will sharing replace owning? In much of the United States and Europe customers have long viewed car ownership as a necessity. That is starting to change with evolving needs, attitudes, and life styles. Whether seeking a simpler life, a desire to save the planet, or just plain economics, many consumers are be- coming more comfortable with car sharing There is an economic case for turning in the keys Monthly payments, insurance, parking, gas, depreciation, and maintenance add up...

  • Can Technology Save Sears? Sears, Roebuck used to be the largest retailer in the United States, w...

    Can Technology Save Sears? Sears, Roebuck used to be the largest retailer in the United States, with sales representing 1 to 2 percent of the U.S. gross national product for almost 40 years after World War II. Since then, Sears has steadily lost ground to discounters such as Walmart and Target and to competitively priced specialty retailers such as Home Depot and Lowe’s. Even the merger with Kmart in 2005 to create Sears Holding Company failed to stop the downward...

  • Fraud at Berry, CPA’s BERRY, CERTIFIED PUBLIC ACCOUNTANTS Brief History of the Firm In 1999, John...

    Fraud at Berry, CPA’s BERRY, CERTIFIED PUBLIC ACCOUNTANTS Brief History of the Firm In 1999, John Berry graduated from college with an accounting degree. After 10 years at an international accounting firm, John decided to start his firm, Berry, CPA’s. The firm, located in Oakwood, caters to local clients; specifically, John and his staff of four professionals specialize in non-public companies. The majority of the services provided by Berry, CPA’s are tax planning and preparation; however, the firm also performs...

  • Caterpillar Inc. 2017 2016 5 S 51,822 2,900 54,722 42,676 2,786 45,462 35,773 2,764 38,537 STATEMENT...

    Caterpillar Inc. 2017 2016 5 S 51,822 2,900 54,722 42,676 2,786 45,462 35,773 2,764 38,537 STATEMENT 1 Consolidated Results of Operations for the Years Ended December 31 Dollar is willions cat pershare dal Sales and revenues Sales of Machinery, Energy & Transportation Revenues of Financial Products Total sales and revenues Operating costs Cost of goods sold Selling, general and administrative expenses Research and development expenses Interest expense of Financial Products Goodwill impairment charge Other operating incomel expenses Total operating costs...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

  • SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the...

    SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...

  • Playgrounds and Performance: Results Management at KaBOOM! (A) We do this work because we want to...

    Playgrounds and Performance: Results Management at KaBOOM! (A) We do this work because we want to make a difference in the world; how can we go further faster? - Darell Hammond, CEO and co-founder, KaBOOM! Darell Hammond stepped onto the elementary school playground and took a long, slow look around. It was 8 a.m. on an unusually warm fall day in 2002 and the playground was deserted, but Hammond knew the children would start arriving soon to admire their new...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT