Computer Science, asked by michelledamian3431, 8 months ago

ype program in the space provide
11. In order to force consumers to use lower Horsepower cars and conserve energy the state adopts a set
of progressive annual license fees based upon the power rating of the car. The criteria and fees are as
follows:
Horsepower
License Fees
Up to 50 Hp
Rs 0/-
More than 50 but 100Hp or less
Rs 300/-
More than 100 but 200Hp or less
Rs 600/-
More than 200 but 300 Hp or less
Rs 900/-
More than 300
Rs 1500/-
Write a program to compute the license fee based on the input value of horsepower.
Qur answer
in java​

Answers

Answered by randhawalovely254
4

desdrert73eggaadft4esftwf

Answered by ViditNarayan
7

Answer:

import java.util.Scanner;

public class program_11

{

   public static void main(String []args)

   {

       double license_fees=0.0;

       Scanner sc=new Scanner(System.in);

       System.out.println("Enter the value of horse power consumed");

       int HP=sc.nextInt();

       if(HP<=50)

       {

           license_fees=0.0;

       }

       else if(HP>50 && HP<=100)

       {

           license_fees=300.0;

       }

       else if(HP>100 && HP<=200)

       {

           license_fees=600.0;

       }

       else if(HP>200 && HP<=300)

       {

           license_fees=900.0;

       }

       else if(HP>300)

       {

           license_fees=1500.0;

       }

       System.out.println("The license fees="+license_fees);

   }

}

Explanation:

Similar questions