In a certain company the cost of software depends on the license type which could be Individual or Enterprise. Write a program that reads  License Type wanted (just the first character of each type: I, i, E, e).  Number of Users to use the software. Type Price/User Minimum number of users Individual 500$ 1 Enterprise 300$ 5 Your program should:  Check if the number of users is greater than or equal than Minimum Number of Users allowed Compute the cost: (for example cost = Cost per user x Number of Users)

Respuesta :

Solution :

import [tex]$\text{java}.$[/tex]util.*;

public [tex]$class$[/tex] currency{

  public static [tex]$\text{void}$[/tex] main(String[tex]$[]$[/tex] args) {

      Scanner input [tex]$=$[/tex] new Scanner(System[tex]$\text{.in}$[/tex]);

      System[tex]$\text{.out.}$[/tex]print("Enter [tex]$\text{number of}$[/tex] quarters:");

      int quarters = input.nextInt();

      System.out.print("Enter number of dimes:");

      int [tex]$\text{dimes =}$[/tex] input.nextInt();

      System[tex]$\text{.out.}$[/tex]print("Enter number of nickels:");

      int nickels = input.nextInt();

      System[tex]$\text{.out.}$[/tex]print("Enter number of pennies:");

      int [tex]$\text{pennies = }$[/tex] input.nextInt();

      // computing dollors

      double dollars = (double) ((quarters*0.25)+(dimes*0.10)+(nickels*0.05)+(pennies*0.01));

      System[tex]$\text{.out.}$[/tex]format("You have : $%.2f",dollars);

  }

}