a store purchased some cola cans of various brands. lt purchased 50 cans @15/-per can, 30 cans @20/- can and 40 can 21/-per can . write a program in java to compute how much amount did the store pay.
Answers
Answered by
1
Answer:
public class KboatColaCans
{
public static void main(String args[]) {
int can1 = 50;
int can2 = 30;
int can3 = 40;
int p1 = 15;
int p2 = 20;
int p3 = 21;
int amt = can1 * p1 + can2 * p3 + can3 * p3;
System.out.println("Amount to be paid = " + amt);
}
}
Explanation:
Similar questions
Social Sciences,
2 months ago
Computer Science,
2 months ago
Math,
5 months ago
History,
5 months ago
Math,
10 months ago
Biology,
10 months ago
History,
10 months ago