Computer Science, asked by rutujapdesai1798, 10 months ago

in order to purchase an old car, the depreciated value can be calculated as per thetariff given below:Rate of depreciationNo. of years used10%20%30%350%60%Above 4 yearsWrite a menu driven program to input showroom price and the number of years the caris used ('1' for one year old, '2' for two years old and so on). Calculate the depreciatedvalue. Display the original price of the car, depreciated value and the amount to bepaid.​

Answers

Answered by Anonymous
1

Explanation:

Hello

here is your answer

A. to analyze items, remove unimportant items, and add important items to the product backlog list

B. to hold meetings to discuss productivity in the development process

C. to keep track of the development process

D. to review and update the complexity and quality of the work

Answered by sanjeevanaravindan
2

Answer:

import java.util.Scanner;

public class Switch_Case{

   public static void main(String []args){

       Scanner sc=new Scanner(System.in);

       double price,dep;

       int year;

      System.out.println("Enter showroom price");

      price=sc.nextFloat();

      System.out.println("Enter numbers of years car is used ");

      year=sc.nextInt();

      switch(year)

      {

          case 1:

              dep=price*0.1;

              break;

          case 2:

              dep=price*0.2;

              break;

          case 3:

              dep=price*0.3;

              break;

          case 4:

              dep=price*0.5;

              break;

          default:

              dep=price*0.6;

      }

      System.out.println("Original Price : "+price);

      System.out.println("Depriciated Value : "+dep);

      System.out.println("Amount to be paid : "+(price-dep));

      }

}

Explanation:

import java.util.Scanner;

public class CarValue

{

   public static void main(String args[]) {

       

       Scanner in = new Scanner(System.in);

       

       System.out.println("1. One year old car");

       System.out.println("2. Two year old car");

       System.out.println("3. Three year old car");

       System.out.println("4. Four year old car");

       System.out.println("5. More than four year old car");

       

       System.out.print("Enter your choice: ");

       int choice = in.nextInt();

       

       if (choice < 1 || choice > 5) {

           System.out.println("Wrong choice! Please select from 1, 2, 3, 4, 5.");

           return;

       }

       

       System.out.print("Enter showroom price: ");

       double price = in.nextDouble();

       double depValue = 0.0;

       

       switch(choice) {

           case 1:

               depValue = 0.1 * price;

               break;

           

           case 2:

               depValue = 0.2 * price;

               break;

           

           case 3:

               depValue = 0.3 * price;

               break;

           

           case 4:

               depValue = 0.5 * price;

               break;

           

           case 5:

               depValue = 0.6 * price;

               break;

           

           default:

               System.out.println("Wrong choice! Please select from 1, 2, 3, 4, 5.");

               break;

       }

       

       double amtPayable = price - depValue;

       

       System.out.println("Original Price = " + price);

       System.out.println("Depricated Value = " + depValue);

       System.out.println("Amount to be paid = " + amtPayable);

   }

}

Similar questions