1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
WARRIOR [948]
3 years ago
8

A bike share program in Indianapolis allows customers to borrow a bike and charge them based on the length of their ride.

Computers and Technology
1 answer:
REY [17]3 years ago
4 0

Answer:

public static double calculate_fee(int lengthofRide, String membership){

       double fee = 0.0;

       if(membership.equalsIgnoreCase("daily")){

           fee = 1.50 +(lengthofRide*20);

       }

       else if (membership.equalsIgnoreCase("annually")){

           fee = 1.0+(lengthofRide*15);

       }

       return fee;

   }

Explanation:

The solution is implemented in Java. The complete code prompting the user to enter ride duration and membership type is given below:

import java.util.Scanner;

public class num4 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter your membership \"daily\" of \"annually\"");

       String membership = in.nextLine();

       System.out.println("Enter your ride duration in minutes");

       int rideTime = in.nextInt();

       //calling the method calculate_fee

       System.out.println("Your total fee based on your membership is "+calculate_fee(rideTime,membership));

   }

   public static double calculate_fee(int lengthofRide, String membership){

       double fee = 0.0;

       if(membership.equalsIgnoreCase("daily")){

           fee = 1.50 +(lengthofRide*20);

       }

       else if (membership.equalsIgnoreCase("annually")){

           fee = 1.0+(lengthofRide*15);

       }

       return fee;

   }

}

You might be interested in
What goes hand and hand with focus? A) company B) non-profit C) business D) organization
Katyanochek1 [597]

Answer:

I think the answer is D but please let me know if i am wrong

Explanation:

8 0
2 years ago
Read 2 more answers
Can an engine run on air? I think it can, but I am not sure
Svetlanka [38]

Hello,

NO, and engine can run on steam, gas and other things but not air.

-Bella

3 0
3 years ago
Read 2 more answers
When a table is displayed in datasheet view, each column represents a select one:
Ksivusya [100]
The answer a. record in the table.
5 0
3 years ago
Of the following, the greatest advantage of a database architecture is that
Zina [86]

Answer:

c.

Explanation:

Of the following, the greatest advantage of a database architecture is that data redundancy can be reduced. This refers to data being unintentionally repeated within the database causing space to be taken up unnecessarily. Database architecture allows for this problem to be addressed and prevented.

3 0
3 years ago
Is there any way to delete old questions on this? if there is no way, take this as a free question​
Lostsunrise [7]

Answer:

moderators have to delete it for u

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of these statements best describes an application programming interface?
    5·1 answer
  • In three to five sentences, explain how you would insert graphics using your word-processing software.
    7·2 answers
  • A person clicks on an ad of a fitness club in a blog on nutrition. The person conducts a search on yoga and moves to another web
    8·1 answer
  • Will the Python code below print something? And will it terminate?
    9·1 answer
  • What does txt atm mean? what does txt atm mean
    8·1 answer
  • You create a storyboard at the _____ stage of web development
    15·2 answers
  • A computer technician is responding to a call about a printer that is causing streaks to appear on every printout. Which of the
    5·1 answer
  • While you are working on your computer, it shuts down unexpectedly, and you detect a burning smell. When you remove the case cov
    10·1 answer
  • The auxiliary device used to store large volume of data and program for future is called​
    10·1 answer
  • Distinguish between a computer drive and computer driver​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!