Completely Stumped

Good morning/afternoon.

I am completely stumped with a programming issue. Let me be clear, I am not looking for someone to do the problem for me, however, I have absolutely no idea how to solve this issue.

We are learning "else if" statements (however, my knowledge is they exist, nothing more) and our assignment is to write a code. The problem breaks down as the following (the names have been changed to protect the innocent):

Gus sells cigars. He sells X and Y cigars, either with or without the ring.
X - $1 w/o; $1.50 with ring
Y - $3 w/o; $4.75 with ring

Gus also gives quantity discounts:
< 50 - 0%
50 - <100 - 5%
100 - <200 - 10%
>= 200 - 15%

In order for this to work, do I need to write an (else if) formula with 4 lines? I also do not know how to make a formula follow the specific entry at the bottom.

Also, we were never taught how to specify a range of numbers, but I am guessing with the (else if) it would look like this:

if (qty <50)
{
Net money = (X or Y) *1
}
else if (qty <100)
Net money = (X or Y)* 0.95
{
else if (qty <200)
Net money = (X or Y)* 0.9
}
else if (qty >=200)
Net money = (X or Y) * 0.85
{
The last is not else if (cond), just else. If the qty is not less than 200, then it must be at least 200; no need to test
Thanks. I will make that adjustment.

However, I have no idea how to even approach this problem.

#include <iostream>
using namespace std;


int main()

{

cout << "Cigar Type" << endl;
cout << " 1. X" << endl;
cout << " 2. Y" << endl;
cout << "Enter selection: " << endl;
cin >> ct;
cout << "Design Type" <<endl;
cout << " 1. Ring" << endl;
cout << " 2. Without Ring" << endl;
cout << "Enter Selection: " << endl;
cin >> r;
cout << "How many cigars are you ordering: " << endl;
cin >> qty;

So do I need to make 16 different else if statements to compute the final output?
I tried defining constants, but we were never even taught how to do that with else if statements. The logic of "Select X or Y", and then it calculates that value into a formula is beyond the material, but it is a question in the assignment
x * four discounts
(x + ring) * four discounts
y * four discounts
(y + ring) * four discounts

I apologize, as my lack of knowledge makes it difficult to ask the questions correctly and intelligently. I will just type out the problem:

(above cigar variables remain)

The program should ask the user what type of cigar they want, then whether it should have a ring or not, and then the total quantity of the purchase. It should then give out the following information:

Quantity:
Cost per Cigar:
Discount:
Total:
Think along these lines:
price = 0
if ( type is X )
  if ( with ring )
    price =
  else
    price =
else if ( type is Y )
  if ( with ring )
    price =
  else
    price =

total = qty * price

determine discount
PERFECT! Thank you.
Topic archived. No new replies allowed.