Answer to Question #14315 in C++ for Marty

Question #14315
Write a program using this information: The Variety Store handles the following discount policy, if you take less than 10 items no discount, if you bring between 10 and 20 items you will be given a 10% discount, when you carry between 21 and 30 items with 20% off and if you carry more than 30 items is 30% off. Note this applies if the above quantities are purchased are items of the same type.
1
Expert's answer
2012-09-07T09:04:54-0400
#include <iostream>
using namespace std;

int main(){
int k = 0;
for (int i = 100 ; i < 200 ; i++){
& if (((i%5 == 0) || (i%6 == 0)) && !((i%5 == 0) && (i%6 == 0))) {
& k++;
&
& cout<<i<<' ';

& if (k == 10) {
& k = 0;
& cout<<endl;
& }
& }
}


system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS