i need the Blue j (java) program to be solved please . i have to submit this program today. topic:- write the program to accept the rate and quantity of 6 items(cornflakes,oats,rice,pulses,soap,biscuits). calculate the bill for 6 customers individually and print he bill by applying of 2% gst. please help me i need it today.
Answers
Answered by
2
Please construct the program yourself.
Make two Single Dimensional arrays of accepting six quantities and their rates.
Scanner sc = new Scanner (System.in);
int rate[] = new int[6];
double qnt[] = new int[6];
double bill = 0.0, tbill = 0.0;
double it[] = new int[6];
Now accept them:
for (int i = 0; i < 6; i++)
{
rate[i] = sc.nextInt();
qnt[i] = sc.nextDouble();
bill[i] = bill + (rate[i]*qnt[i]);
it[i] = bill + (0.02*bill); //bill including GST
}
for (i = 0; i < 6; i++)
{
tbill = tbill + it[i];
}
System.out.println("Total bill is: " + tbill);
hope it helps
Make two Single Dimensional arrays of accepting six quantities and their rates.
Scanner sc = new Scanner (System.in);
int rate[] = new int[6];
double qnt[] = new int[6];
double bill = 0.0, tbill = 0.0;
double it[] = new int[6];
Now accept them:
for (int i = 0; i < 6; i++)
{
rate[i] = sc.nextInt();
qnt[i] = sc.nextDouble();
bill[i] = bill + (rate[i]*qnt[i]);
it[i] = bill + (0.02*bill); //bill including GST
}
for (i = 0; i < 6; i++)
{
tbill = tbill + it[i];
}
System.out.println("Total bill is: " + tbill);
hope it helps
sum1003:
i am in tension please reply me
Similar questions
Math,
8 months ago
Math,
8 months ago
Math,
1 year ago
Social Sciences,
1 year ago
Environmental Sciences,
1 year ago
Math,
1 year ago