Question

In: Computer Science

CODE IN JAVA A computer company sells software and computer packages for $75. Quantity discounts are...

CODE IN JAVA

A computer company sells software and computer packages for $75. Quantity discounts are given based on the following criteria:

Quantity          Discount

10 - 19             20%
20 - 49             30%
50 - 99             40%
100 or more    50%

Be sure the user is presented with all necessary information, then prompt the user for the quantity of packages. Display the total cost of the purchase making sure to apply appropriate discounts.

Example Output:

Demon software and computers is offering discounts on the Vic Package. This package includes a computer and needed software to perform basic daily functions. The Vic package sells for $75.00. Discounts are given based on quantity. The discounts are listed below:

10 - 19 gives a 20% discount
20 - 49 gives a 30% discount
50 - 99 gives a 40% discount
100 or more gives a 50% discount

How many would you like to purchase?

25

You purchased 25 packages. Your total is $1312.50

Solutions

Expert Solution

package stock;

import java.util.Scanner;

public class Stock {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in); // object to take input
        //prompting the user with required output
        System.out.println("Demon software and computers is offering discounts on the Vic Package. This package includes a \n computer and needed software to perform basic daily functions. The Vic package sells for $75.00.\n Discounts are given based on quantity. The discounts are listed below:");
        System.out.println("10 - 19 gives a 20% discount");
        System.out.println("20 - 49 gives a 30% discount");
        System.out.println("50 - 99 gives a 40% discount");
        System.out.println("100 or more gives a 50% discount");
        System.out.println("How many would you like to purchase?");
        int quantity = sc.nextInt(); //taking quantity input
        
        double purchase;
        purchase = quantity * 75; //calculating price
        
        //giving discount according to order
        if(quantity >= 10 && quantity <= 19)
            purchase = purchase - (purchase * 0.20);
        
        if(quantity >= 20 && quantity <= 49)
            purchase = purchase - (purchase * 0.30);
        
        if(quantity >= 50 && quantity <= 99)
            purchase = purchase - (purchase * 0.40);
        
        if(quantity >= 100)
            purchase = purchase - (purchase * 0.50);
        
        //required output
        System.out.println("You purchased " + quantity + " packages. Your total is $" + purchase);
    }
    
}

\n is use in print statement to break line so that the bigger line can be printed and can be adjusted in output window,

Note:- Please comment down if you face any problem. :)


Related Solutions

========================================================================= A software company sells a package that retails for $99. Quantity discounts are given according...
========================================================================= A software company sells a package that retails for $99. Quantity discounts are given according to the following table. Quantity Discount 10–19 20% 20–49 30% 50–99 40% 100 or more 50% Write a program that asks for the number of units sold and computes the total cost of the purchase. Input Validation: Make sure the number of units is greater than 0. ========================================================================= the pseudo code is: There comes situations in real life when we need to make some...
this is in excel VB8 Program 2: Software Sales A software company sells three packages, Package...
this is in excel VB8 Program 2: Software Sales A software company sells three packages, Package A, Package B, and Package C, which retail for $99, $199, and $299, respectively. Quantity discounts are given according to the following table: Quantity Discount 10 through 19 20% 20 through 49 30% 50 through 99 40% 100 or more 50% Create an application that allows the user to enter the number of units sold for each software package. The application should calculate and...
A company sells a product for a retail price of $100. It offers quantity discounts based...
A company sells a product for a retail price of $100. It offers quantity discounts based on the table below Quantity Discount 10-19 10% 20-49 20% 50-99 30% 100 or more 40% Write a program that asks user for enter the quantity of product they want to purchase. It should then display the discount amount (if any) and the total purchase amount after the discount. The output should be displayed with 2 decimal points as shown below. See a sample...
Use computer software packages, such as Excel, to solve this problem. The Jacobs Chemical Company wants...
Use computer software packages, such as Excel, to solve this problem. The Jacobs Chemical Company wants to estimate the mean time (minutes) required to mix a batch of material on machines produced by three different manufacturers. To limit the cost of testing, four batches of material were mixed on machines produced by each of the three manufacturers. The times needed to mix the material follow. Manufacturer 1 Manufacturer 2 Manufacturer 3 17 29 17 23 27 16 21 32 20...
Software Sales A software company sells three packages, Package A, Package B, and Package C, which...
Software Sales A software company sells three packages, Package A, Package B, and Package C, which retail for $99, $199, and $299, respectively. Quantity discounts are given according to the following table: Quantity Discount 10 through 19 20% ,20 through 49 30% ,50 through 99 40% ,100 or more 50% . Create a C++ program that allows the user to enter the number of units sold for each software package. The application should calculate and display the order amounts and...
Task #1 – Software Sales A software company sells a package that retails for $99. Quantity...
Task #1 – Software Sales A software company sells a package that retails for $99. Quantity discounts are given according to the following: Quantity Discount 1 - 9 NO DISCOUNT 10 – 19 20% 20 – 49 30% 50 – 99 40% 100 or more 50% Your program calculates the final purchase price of the software packages based on the quantity purchased. If a value of 0 or less (a negative number) is entered, display the message “Invalid Quantity” and...
6. Some personal computer software is sold at special discounts to students. Other software is provided...
6. Some personal computer software is sold at special discounts to students. Other software is provided in a less powerful version for students. Why do publishers offer discounts to students? What is the purpose of developing less powerful editions? 7. Using the kinked demand model, explain why a decrease in costs might not lead to a change in price or output (see Chapter 10). 10. Stargazer Recordings sells compact discs in two markets. The marginal cost of each disc is...
Cutting Edge Incorporated is a company engaged in the development of computer-aided design (CAD) software packages....
Cutting Edge Incorporated is a company engaged in the development of computer-aided design (CAD) software packages. The management of Cutting Edge wants to develop a project tracking system to accumulate and report data on current projects, employees and departments. They have given you the following attributes they store on an excel spreadsheet. A project can have several employees assigned to it. An employee belongs to only one department. Make any necessary assumptions and normalize to 3NF. (ProjectNumber, ProjectName, StartDate, ProjectStatus,...
Classification of Cryptocurrency Holdings (Adapted) Software Provider (the “Company”) supports and sells computer software. The Company...
Classification of Cryptocurrency Holdings (Adapted) Software Provider (the “Company”) supports and sells computer software. The Company accepts cryptocurrencies (e.g., Bitcoin, Ether, Ripple) as payment for the sale of its computer software. The Company holds its cryptocurrencies partially for investment (e.g., expectation that they will appreciate in value) and partially to use in the future to purchase goods or services. Cryptocurrency is a new type of value and payment method that is different from fiat currency (e.g., U.S. dollars and foreign...
An airline wants to select a computer software package for its reservation system. Four software packages...
An airline wants to select a computer software package for its reservation system. Four software packages (1, 2, 3, and 4) are commercially available. The airline will choose the package that bumps as few passengers, on the average, as possible during a month. An experiment is set up in which each package is used to make reservations for 5 randomly selected weeks. (A total of 20 weeks was included in the experiment.) The number of passengers bumped each week is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT