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
Which of the following statements contains an error?
ASHA 777 [7]
I. is syntactically correct if genderString exists. if genderString, for example, is "Male", then char gender would be the character at index 0 (the first character), meaning 'M'.

II. is incorrect. It is using the comparison operator (==) instead of the assignment operator (=). It is also setting a boolean variable to a String value of 'F'. Boolean values cannot hold string values, and can only hold true & false. 

III. is correct if ageString only contains numbers (presumably, it does, as it's called ageString). Integer.parseInt is a function that converts String values to integer values if the string values only contain numerical characters.

The answer in this case should be B. II only.
5 0
3 years ago
Describe the object-oriented software engineering approach.
Jobisdone [24]

Answer:

 The object oriented software engineering approach is basically focus on the attention for capture the given structure and conduct the data frameworks in the form of small module which consolidates the information and the procedure.

The principle and aim of the Object Oriented Design (OOD) is that improving the quality of the system analysis and increase its productivity and more usable efficiently.

There are different phases in the object oriented software engineering approach are as follows:

  • Firstly, we start analyze and define the particular system
  • Then, construct the analysis model based on the above approach of the specific system.
  • We verify the correctness of the system by using the testing.

3 0
3 years ago
Assume the following two classes as Person and Working: class Person { int personID, age; String fName, middleName, lastName; ..
Troyanec [42]

Answer:

A)

This is an example of tight coupling since the class Working has to have an idea of how Person is implemented to complete its own implementation.

B)

Any change in the Person class would require a change in the working class too.

C)

CODE

class Person {

int personID, age;

String fName, middleName, lastName;

public int getAge() {

return age;

}

}

// end of Person class

class Working extends Person {

boolean isUnderEighteen() {

if (super.getAge() <18) {

System.out.println("The person is under age and cannot work");

return true;

}

else {

System.out.println("The person can legitimately work");

return false;

}

}

}

Explanation:

4 0
3 years ago
Computers influenced the outcome of world war 2 by?
Elan Coil [88]

Answer:

Computers were introduced to the U.S. Navy on the eve of war for submarines. The computers used trigonometry to help the submariners know when to fire their torpedoes at a moving target. These devices were expanded to surface ships to provide more accurate firing of the guns.

Explanation:

3 0
2 years ago
Guys, if you ask a question on here and someone answers but they only provide a link and their username starts with a G, ITS A H
Galina-37 [17]

Answer:

oki

Explanation:

3 0
2 years ago
Other questions:
  • Which of these is outside the scope of an art director's responsibility?
    12·2 answers
  • You’ve received a tarball called data79.tar from a colleague, but you want to check the names of the files it contains before ex
    15·1 answer
  • Data silos are often associated with ________________.
    12·1 answer
  • Jane is debugging a code consisting of 25 lines. The code starts executing at line 11. At line 13, the code calls another method
    10·2 answers
  • 6. Consider a circle of diameter d cm.
    11·1 answer
  • What language must be used to display a bare-minimum webpage?
    8·2 answers
  • A derived class is a class that inherits data members and functions from a ____ class.
    6·1 answer
  • Apex
    5·2 answers
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • During the design phase, development teams translate the requirements into?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!