Computer Science, asked by snehasingh091105, 5 months ago

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 Anonymous
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