(Invoice class

Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables— a part number (type string), a part description (type string), a quantity of the item being purchased (type int) and a price per item (decimal). Your class should have a constructor that initializes the four instance variables. Provide a property with a get and set accessor for each instance variable. In addition, provide a method named GetInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a decimal value. If the quantity is negative, it should be left unchanged. Similarly, if the price per item is negative, it should be left unchanged. Write a test application named InvoiceTest that demonstrates class Invoice’s capabilities.

You should do this your self,
I will just show you a few things to get started with:

#include <iostream>
#include <math.h>

//Here are the variables//
string partnum;
string descript;
int quan;
double price;

int main(int nNumberofArgs, char* pszArgs[]) {
  //Coding for program starts here//
}

And you write the program I just gave you the beginning.
Hope this helps :D

int main(int nNumberofArgs, char* pszArgs[]) {

Coders will have your head for not using argc and argv. xD

Coders will have your head for not using argc and argv. xD

And the lack of code-tags
And the use of global variables.
And posting absolutely unrelated code to the OP original problem.

On topic: Here's a tutorial on Classes, it will help you (OP) to get started.

>Coders will have your head for not using argc and argv. xD
Nah, but the hungarian notation will start wars. ;)

Comments
Let's not go down that road :)
This article has been dead for over six months. Start a new discussion instead.