Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A large Internet merchandise provider determines its shipping charges based on t

ID: 3668937 • Letter: A

Question

A large Internet merchandise provider determines its shipping charges based on the number of items purchased. As the number increases, the shipping charges proportionally decrease. This is done to encourage more purchases. If a single item is purchased, the shipping charge is $2.99. When customers purchase between 2 and 5 items, they are charged the initial $2.99 for the first item and then $1.99 per item for the remaining items. For customers who purchase more than 5 items but less than 15, they are charged the initial $2.99 for the first item, $1.99 per item for items 2 through 5, and $1.49 per item for the remaining items. If they purchase 15 or more items, they are charged the initial $2.99 for the first item, $1.99 per item for items 2 through 5, and $1.49 per item for items 6 through 14, and then just $0.99 per item for the remaining items. Allow the user to enter the number of items purchased. Define appropriate constants, use the decimal data type, and display the ship- ping formatted charges.

**I am using Visual Studio C# if you could please accomodate, Thanks!

Explanation / Answer

import java.util.Scanner;
import java.text.DecimalFormat;

public class ShippingCompany {
public static void main(String [] args) {
Scanner in = new Scanner(System.in);
DecimalFormat df = new DecimalFormat("#.00");
double item, distance, distanceTemp;
double cost = 0.0;
int count = 0;

System.out.println("Shipping charges chages as number of item increses");
do {
System.out.print("Enter Weight of Packages (in Kilograms): ");
item = in.nextDouble();
if(item ==1) {
System.out.println("charges will be $2.99.");

else if(item = 2 && item > 5)

system.out.println("charges will be $2.99);

}


} while(item<= 15 || item > 5);
System.out.print("shipping charges $2.99 ");



if(weight <= 15) {
cost = count * 2.99;
} else if(weight > 2 && weight <= 6) {
cost = count * 2.20;
} else if(weight > 6 && weight <= 10) {
cost = count * 3.70;
} else if(weight > 10) {
cost = count * 4.80;
}

System.out.println("The shipping charges $" + df.format(cost));
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote