Answer:
public class num9 {
public static void main(String[] args) {
int sum =0;
int num =5;
for(num =5; num<=500; num+=5){
System.out.println(num);
sum +=num;
}
System.out.println(sum);
}
}
Explanation:
- Declare and initialize the variables sum and num
- Use a for loop with the condition for(num =5; num<=500; num+=5) Since the loop will increment by 5 and run from 5 to 500
- Within the loop, add num to sum at each iteration
- Print all elements on seperate lines
- Outside the loop, print the final value of sum
Create a for loop
A i believe is the answer
Answer:
Explanation:
Shipping fee is based on the weight of the item purchased
Name of the store- MIMI Electronics
Items sold- Consumer electronics, mobiles phones, laptops, wearable devices, accessories, digital watches etc
Shipping charges-
Weight Shipping fee
0-1 kg $ 5.00
1-2 kg $ 10.00
2-4 kg $ 15.00
4-7 kg $ 20.00
7-10 kg $ 30.00
10 kg + $ 50.00
Shipping fee function
F(x)= 5 for all x [0,1]
F(x)= 10 for all x (1,2]
F(x)= 15 for all x (2,4]
F(x)= 20 for all x (4,7]
F(x)= 30 for all x (7,10]
F(x)= 50 for all x (10,infinity)
shipping charge function is a step function where the steps are mentioned in terms of weight.
Shipping charge could also be determined using a piece wise function where the shipping fee is fixed for each piece and is charged based on number of pieces ordered instead of weight of the order
Answer:
Following is the detailed answer as needed.
<h3>I hope it will help you!</h3>
Explanation: