Someone pls help


//To practice writing programs using loops.Write a program that will allow the user to buy notebook(s), pen(s), pencil(s) and / or a calculator from your store and display the total due. 1.
//
//User Input
//Your program should first ask the user what item he / she wants to purchase.If the user indicates an item that your store does not sell, an error message
//should display telling the user that you don’t sell that item.
//b.
//
//If the user indicates a notebook, pen, or pencil, ask the user how many of the item he / she wants to buy.Make sure that the input is a positive number before proceeding.c.
//
//If the user indicates a calculator, you can assume he / she wants to buy just one.Your program should ask which type of calculator they want to buy, instead of how many. 2.
//
//Calculate and display the subtotal to the user.The prices for the items are as follows : Notebooks are $1.50 each

//Pens are $.30 each, unless the user enters the coupon cod
//e “pen123.”

//If the user enters the code, pens are $.25 each

//Pencils are $.20 each if the user buys less than 5.

//Pencils are $.15 each if the user buys 5 or greater, but less than 10.

//Pencils are $.10 each if the user buys 10 or greater

#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

int main()
{
string items;
double num_notebooks;
double num_pencils;
cout << "Welcome to Ade's Bookstore, we sell Notebooks, Pens, Pencils and Calculators at this store" << endl;
cout << " " << endl;
cout << "What item would you like to purchase: ";
cin >> items;

if (items == "NOTEBOOK" || "Notebook" || "notebook")
{
cout << "How many " << items << " would you like to purchase: ";

cin >> num_notebooks;
const double price_NOTEBOOK = 1.50;
double total_price1;
total_price1 = price_NOTEBOOK * num_notebooks;
cout << "The total amount is: " << total_price1 << endl;
}
else if (items == "PENCIL" || "Pencil" || "pencil")
{
cout << "How many " << items << " would you like to purchase: ";
cin >> num_pencils;
const double price_PENCILS = 2;
double total_price2;
total_price2 = price_PENCILS * num_pencils;
cout << "The total amount is: " << total_price2 << endl;
}
else
{
cout << "The item you entered is not available at this bookstore" << endl;
system("pause");
return 0;
}














system("pause");
return 0;
}
Last edited on
So? What the problem is?
Topic archived. No new replies allowed.