SlideShare a Scribd company logo
#include "stdafx.h"
#include
using namespace std;
class Inventory
{
private:
int itemNumber;
int quantity;
double cost;
double totalCost;
public:
Inventory()
{
itemNumber = 0;
quantity = 0;
cost = 0;
totalCost = 0;
}
Inventory(int newItemNumber, int newQuantity, double newCost)
{
itemNumber = newItemNumber;
quantity = newQuantity;
cost = newCost;
setTotalCost(quantity, cost); // this can be called as quantity and cost have now been
initialized.
}
void setItemNumber(int)
{
itemNumber = itemNumber;
}
void setQuantity(int)
{
quantity = quantity;
}
void setCost(double)
{
cost = cost;
}
void setTotalCost(int, double)
{
totalCost = quantity * cost;
}
int getItemNumber()
{
return itemNumber;
}
int getQuantity()
{
return quantity;
}
double getCost()
{
return cost;
}
double getTotalCost()
{
return totalCost;
}
};
int main()
{
int itemNumber;
int quantity;
double cost;
double totalCost;
cout << "Enter the Item Number: ";
cin >> itemNumber;
while (itemNumber < 0)
{
cout << "Please enter a positive value for the Item Number: ";
cin >> itemNumber;
}
cout << "Enter the Quantity of the item: ";
cin >> quantity;
while (quantity < 0)
{
cout << "Please enter a positive value for the Quantity of the item: ";
cin >> quantity;
}
cout << "Enter the Cost of the item: ";
cin >> cost;
while (cost < 0)
{
cout << "Please enter a positive value for the Cost of the item: ";
cin >> cost;
}
Inventory information(itemNumber, quantity, cost);
totalCost = information.getTotalCost();
itemNumber = information.getItemNumber();
cost = information.getCost();
quantity = information.getQuantity();
cout << "The Item Number is: " << itemNumber << endl;
cout << "The Quantity is: " << quantity << endl;
cout << "The Cost is: " << cost << endl;
cout << "The Total Cost is: " << totalCost << endl;
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
Solution
#include "stdafx.h"
#include
using namespace std;
class Inventory
{
private:
int itemNumber;
int quantity;
double cost;
double totalCost;
public:
Inventory()
{
itemNumber = 0;
quantity = 0;
cost = 0;
totalCost = 0;
}
Inventory(int newItemNumber, int newQuantity, double newCost)
{
itemNumber = newItemNumber;
quantity = newQuantity;
cost = newCost;
setTotalCost(quantity, cost); // this can be called as quantity and cost have now been
initialized.
}
void setItemNumber(int)
{
itemNumber = itemNumber;
}
void setQuantity(int)
{
quantity = quantity;
}
void setCost(double)
{
cost = cost;
}
void setTotalCost(int, double)
{
totalCost = quantity * cost;
}
int getItemNumber()
{
return itemNumber;
}
int getQuantity()
{
return quantity;
}
double getCost()
{
return cost;
}
double getTotalCost()
{
return totalCost;
}
};
int main()
{
int itemNumber;
int quantity;
double cost;
double totalCost;
cout << "Enter the Item Number: ";
cin >> itemNumber;
while (itemNumber < 0)
{
cout << "Please enter a positive value for the Item Number: ";
cin >> itemNumber;
}
cout << "Enter the Quantity of the item: ";
cin >> quantity;
while (quantity < 0)
{
cout << "Please enter a positive value for the Quantity of the item: ";
cin >> quantity;
}
cout << "Enter the Cost of the item: ";
cin >> cost;
while (cost < 0)
{
cout << "Please enter a positive value for the Cost of the item: ";
cin >> cost;
}
Inventory information(itemNumber, quantity, cost);
totalCost = information.getTotalCost();
itemNumber = information.getItemNumber();
cost = information.getCost();
quantity = information.getQuantity();
cout << "The Item Number is: " << itemNumber << endl;
cout << "The Quantity is: " << quantity << endl;
cout << "The Cost is: " << cost << endl;
cout << "The Total Cost is: " << totalCost << endl;
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

More Related Content

Similar to #include stdafx.h#include iostreamusing namespace std;cl.pdf

template-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdftemplate-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdf
ashokadyes
 
I have created a class hasdhedDictionary that implements the Diction.pdf
I have created a class hasdhedDictionary that implements the Diction.pdfI have created a class hasdhedDictionary that implements the Diction.pdf
I have created a class hasdhedDictionary that implements the Diction.pdf
allystraders
 
This is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdfThis is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdf
info334223
 
Need help with writing the test cases for the following code in java-.docx
Need help with writing the test cases for the following code in java-.docxNeed help with writing the test cases for the following code in java-.docx
Need help with writing the test cases for the following code in java-.docx
LucasmHKChapmant
 
Given main() in the Inventory class, define an insertAtFront() metho.pdf
Given main() in the Inventory class, define an insertAtFront() metho.pdfGiven main() in the Inventory class, define an insertAtFront() metho.pdf
Given main() in the Inventory class, define an insertAtFront() metho.pdf
illyasraja7
 
Infinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtilInfinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtil
Infinum
 
Create a Dynamic Array container with this user interface Ge.pdf
Create a Dynamic Array container with this user interface  Ge.pdfCreate a Dynamic Array container with this user interface  Ge.pdf
Create a Dynamic Array container with this user interface Ge.pdf
sktambifortune
 
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdfHow do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
mail931892
 
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
BANSALANKIT1077
 
Character.cpphpp givenCharacter.cpp#include Character.hp.pdf
Character.cpphpp givenCharacter.cpp#include Character.hp.pdfCharacter.cpphpp givenCharacter.cpp#include Character.hp.pdf
Character.cpphpp givenCharacter.cpp#include Character.hp.pdf
txkev
 
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptxvectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
VivekSharma34623
 
Help explain the code with line comments public class CompletedLis.pdf
Help explain the code with line comments public class CompletedLis.pdfHelp explain the code with line comments public class CompletedLis.pdf
Help explain the code with line comments public class CompletedLis.pdf
almonardfans
 
Please review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdfPlease review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdf
fathimafancyjeweller
 
Java: Nie popełniaj tych błędów!
Java: Nie popełniaj tych błędów!Java: Nie popełniaj tych błędów!
Java: Nie popełniaj tych błędów!
Daniel Pokusa
 
I keep getting an error about m_pHead in printStoresInfo(); function.pdf
I keep getting an error about m_pHead in printStoresInfo(); function.pdfI keep getting an error about m_pHead in printStoresInfo(); function.pdf
I keep getting an error about m_pHead in printStoresInfo(); function.pdf
flashfashioncasualwe
 
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdfHelp please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
arorastores
 
For the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdfFor the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdf
xlynettalampleyxc
 
Given an array nums of size n- return the majority element- The majori.pdf
Given an array nums of size n- return the majority element- The majori.pdfGiven an array nums of size n- return the majority element- The majori.pdf
Given an array nums of size n- return the majority element- The majori.pdf
MattCu9Parrd
 
Writing native bindings to node.js in C++
Writing native bindings to node.js in C++Writing native bindings to node.js in C++
Writing native bindings to node.js in C++
nsm.nikhil
 

Similar to #include stdafx.h#include iostreamusing namespace std;cl.pdf (20)

template-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdftemplate-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdf
 
I have created a class hasdhedDictionary that implements the Diction.pdf
I have created a class hasdhedDictionary that implements the Diction.pdfI have created a class hasdhedDictionary that implements the Diction.pdf
I have created a class hasdhedDictionary that implements the Diction.pdf
 
This is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdfThis is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdf
 
PathOfMostResistance
PathOfMostResistancePathOfMostResistance
PathOfMostResistance
 
Need help with writing the test cases for the following code in java-.docx
Need help with writing the test cases for the following code in java-.docxNeed help with writing the test cases for the following code in java-.docx
Need help with writing the test cases for the following code in java-.docx
 
Given main() in the Inventory class, define an insertAtFront() metho.pdf
Given main() in the Inventory class, define an insertAtFront() metho.pdfGiven main() in the Inventory class, define an insertAtFront() metho.pdf
Given main() in the Inventory class, define an insertAtFront() metho.pdf
 
Infinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtilInfinum Android Talks #20 - DiffUtil
Infinum Android Talks #20 - DiffUtil
 
Create a Dynamic Array container with this user interface Ge.pdf
Create a Dynamic Array container with this user interface  Ge.pdfCreate a Dynamic Array container with this user interface  Ge.pdf
Create a Dynamic Array container with this user interface Ge.pdf
 
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdfHow do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
 
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
 
Character.cpphpp givenCharacter.cpp#include Character.hp.pdf
Character.cpphpp givenCharacter.cpp#include Character.hp.pdfCharacter.cpphpp givenCharacter.cpp#include Character.hp.pdf
Character.cpphpp givenCharacter.cpp#include Character.hp.pdf
 
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptxvectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
 
Help explain the code with line comments public class CompletedLis.pdf
Help explain the code with line comments public class CompletedLis.pdfHelp explain the code with line comments public class CompletedLis.pdf
Help explain the code with line comments public class CompletedLis.pdf
 
Please review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdfPlease review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdf
 
Java: Nie popełniaj tych błędów!
Java: Nie popełniaj tych błędów!Java: Nie popełniaj tych błędów!
Java: Nie popełniaj tych błędów!
 
I keep getting an error about m_pHead in printStoresInfo(); function.pdf
I keep getting an error about m_pHead in printStoresInfo(); function.pdfI keep getting an error about m_pHead in printStoresInfo(); function.pdf
I keep getting an error about m_pHead in printStoresInfo(); function.pdf
 
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdfHelp please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
 
For the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdfFor the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdf
 
Given an array nums of size n- return the majority element- The majori.pdf
Given an array nums of size n- return the majority element- The majori.pdfGiven an array nums of size n- return the majority element- The majori.pdf
Given an array nums of size n- return the majority element- The majori.pdf
 
Writing native bindings to node.js in C++
Writing native bindings to node.js in C++Writing native bindings to node.js in C++
Writing native bindings to node.js in C++
 

More from aashwini4

1. True2. TrueSolution1. True2. True.pdf
1. True2. TrueSolution1. True2. True.pdf1. True2. TrueSolution1. True2. True.pdf
1. True2. TrueSolution1. True2. True.pdf
aashwini4
 
1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf
1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf
1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf
aashwini4
 
OH component .pdf
                     OH component                                     .pdf                     OH component                                     .pdf
OH component .pdf
aashwini4
 
moles of Na2CO3 = massmolecular mass = 0.50106 .pdf
                     moles of Na2CO3 = massmolecular mass = 0.50106 .pdf                     moles of Na2CO3 = massmolecular mass = 0.50106 .pdf
moles of Na2CO3 = massmolecular mass = 0.50106 .pdf
aashwini4
 
Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf
                     Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf                     Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf
Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf
aashwini4
 
E.moles of solute per liter of of solution .pdf
                     E.moles of solute per liter of of solution       .pdf                     E.moles of solute per liter of of solution       .pdf
E.moles of solute per liter of of solution .pdf
aashwini4
 
   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf
   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf
   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf
aashwini4
 
We are generally omitt the concentration of the solids &the concentr.pdf
We are generally omitt the concentration of the solids &the concentr.pdfWe are generally omitt the concentration of the solids &the concentr.pdf
We are generally omitt the concentration of the solids &the concentr.pdf
aashwini4
 
COVALENT ionic hydrogen bonding .pdf
                     COVALENT ionic hydrogen bonding                  .pdf                     COVALENT ionic hydrogen bonding                  .pdf
COVALENT ionic hydrogen bonding .pdf
aashwini4
 
The reaction is maintained at a low temperature with slow addition o.pdf
The reaction is maintained at a low temperature with slow addition o.pdfThe reaction is maintained at a low temperature with slow addition o.pdf
The reaction is maintained at a low temperature with slow addition o.pdf
aashwini4
 
There are two reasons.1. Presence of natural immunity2. Immunity.pdf
There are two reasons.1. Presence of natural immunity2. Immunity.pdfThere are two reasons.1. Presence of natural immunity2. Immunity.pdf
There are two reasons.1. Presence of natural immunity2. Immunity.pdf
aashwini4
 
The difference between maximization of value of the corporation and .pdf
The difference between maximization of value of the corporation and .pdfThe difference between maximization of value of the corporation and .pdf
The difference between maximization of value of the corporation and .pdf
aashwini4
 
The changes between the steady state.SolutionThe changes betwe.pdf
The changes between the steady state.SolutionThe changes betwe.pdfThe changes between the steady state.SolutionThe changes betwe.pdf
The changes between the steady state.SolutionThe changes betwe.pdf
aashwini4
 
Spore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdf
Spore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdfSpore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdf
Spore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdf
aashwini4
 
b) the solutes volatilize at different rates in t.pdf
                     b) the solutes volatilize at different rates in t.pdf                     b) the solutes volatilize at different rates in t.pdf
b) the solutes volatilize at different rates in t.pdf
aashwini4
 
Partnership Firms are taxed at multiple levels the Corporate Level.pdf
Partnership Firms are taxed at multiple levels  the Corporate Level.pdfPartnership Firms are taxed at multiple levels  the Corporate Level.pdf
Partnership Firms are taxed at multiple levels the Corporate Level.pdf
aashwini4
 
Please give the problem detailsWhat are the solutions being mixed.pdf
Please give the problem detailsWhat are the solutions being mixed.pdfPlease give the problem detailsWhat are the solutions being mixed.pdf
Please give the problem detailsWhat are the solutions being mixed.pdf
aashwini4
 
One case of paternity testing has been given in the figure. Four aut.pdf
One case of paternity testing has been given in the figure. Four aut.pdfOne case of paternity testing has been given in the figure. Four aut.pdf
One case of paternity testing has been given in the figure. Four aut.pdf
aashwini4
 
Answer is D. I (1) will add at the carbonyl rath.pdf
                     Answer is D.  I (1) will add at the carbonyl rath.pdf                     Answer is D.  I (1) will add at the carbonyl rath.pdf
Answer is D. I (1) will add at the carbonyl rath.pdf
aashwini4
 
Nasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdf
Nasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdfNasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdf
Nasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdf
aashwini4
 

More from aashwini4 (20)

1. True2. TrueSolution1. True2. True.pdf
1. True2. TrueSolution1. True2. True.pdf1. True2. TrueSolution1. True2. True.pdf
1. True2. TrueSolution1. True2. True.pdf
 
1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf
1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf
1. Seminal vesicle2. Prostate gland3. bulbourethral gland4. Ep.pdf
 
OH component .pdf
                     OH component                                     .pdf                     OH component                                     .pdf
OH component .pdf
 
moles of Na2CO3 = massmolecular mass = 0.50106 .pdf
                     moles of Na2CO3 = massmolecular mass = 0.50106 .pdf                     moles of Na2CO3 = massmolecular mass = 0.50106 .pdf
moles of Na2CO3 = massmolecular mass = 0.50106 .pdf
 
Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf
                     Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf                     Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf
Hydronium ion = hydrogen ion [H3O+] = [H+] = 2.15.pdf
 
E.moles of solute per liter of of solution .pdf
                     E.moles of solute per liter of of solution       .pdf                     E.moles of solute per liter of of solution       .pdf
E.moles of solute per liter of of solution .pdf
 
   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf
   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf
   This is mainly based on Hard - Soft acid base theory.Hard Acid .pdf
 
We are generally omitt the concentration of the solids &the concentr.pdf
We are generally omitt the concentration of the solids &the concentr.pdfWe are generally omitt the concentration of the solids &the concentr.pdf
We are generally omitt the concentration of the solids &the concentr.pdf
 
COVALENT ionic hydrogen bonding .pdf
                     COVALENT ionic hydrogen bonding                  .pdf                     COVALENT ionic hydrogen bonding                  .pdf
COVALENT ionic hydrogen bonding .pdf
 
The reaction is maintained at a low temperature with slow addition o.pdf
The reaction is maintained at a low temperature with slow addition o.pdfThe reaction is maintained at a low temperature with slow addition o.pdf
The reaction is maintained at a low temperature with slow addition o.pdf
 
There are two reasons.1. Presence of natural immunity2. Immunity.pdf
There are two reasons.1. Presence of natural immunity2. Immunity.pdfThere are two reasons.1. Presence of natural immunity2. Immunity.pdf
There are two reasons.1. Presence of natural immunity2. Immunity.pdf
 
The difference between maximization of value of the corporation and .pdf
The difference between maximization of value of the corporation and .pdfThe difference between maximization of value of the corporation and .pdf
The difference between maximization of value of the corporation and .pdf
 
The changes between the steady state.SolutionThe changes betwe.pdf
The changes between the steady state.SolutionThe changes betwe.pdfThe changes between the steady state.SolutionThe changes betwe.pdf
The changes between the steady state.SolutionThe changes betwe.pdf
 
Spore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdf
Spore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdfSpore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdf
Spore forming bacteria (prokaryotes) such as Bacillus anthracis can .pdf
 
b) the solutes volatilize at different rates in t.pdf
                     b) the solutes volatilize at different rates in t.pdf                     b) the solutes volatilize at different rates in t.pdf
b) the solutes volatilize at different rates in t.pdf
 
Partnership Firms are taxed at multiple levels the Corporate Level.pdf
Partnership Firms are taxed at multiple levels  the Corporate Level.pdfPartnership Firms are taxed at multiple levels  the Corporate Level.pdf
Partnership Firms are taxed at multiple levels the Corporate Level.pdf
 
Please give the problem detailsWhat are the solutions being mixed.pdf
Please give the problem detailsWhat are the solutions being mixed.pdfPlease give the problem detailsWhat are the solutions being mixed.pdf
Please give the problem detailsWhat are the solutions being mixed.pdf
 
One case of paternity testing has been given in the figure. Four aut.pdf
One case of paternity testing has been given in the figure. Four aut.pdfOne case of paternity testing has been given in the figure. Four aut.pdf
One case of paternity testing has been given in the figure. Four aut.pdf
 
Answer is D. I (1) will add at the carbonyl rath.pdf
                     Answer is D.  I (1) will add at the carbonyl rath.pdf                     Answer is D.  I (1) will add at the carbonyl rath.pdf
Answer is D. I (1) will add at the carbonyl rath.pdf
 
Nasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdf
Nasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdfNasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdf
Nasal cavity( nasal mucosa)-In humans, olfaction occurs when odora.pdf
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 

#include stdafx.h#include iostreamusing namespace std;cl.pdf

  • 1. #include "stdafx.h" #include using namespace std; class Inventory { private: int itemNumber; int quantity; double cost; double totalCost; public: Inventory() { itemNumber = 0; quantity = 0; cost = 0; totalCost = 0; } Inventory(int newItemNumber, int newQuantity, double newCost) { itemNumber = newItemNumber; quantity = newQuantity; cost = newCost; setTotalCost(quantity, cost); // this can be called as quantity and cost have now been initialized. } void setItemNumber(int) { itemNumber = itemNumber; } void setQuantity(int) { quantity = quantity; } void setCost(double)
  • 2. { cost = cost; } void setTotalCost(int, double) { totalCost = quantity * cost; } int getItemNumber() { return itemNumber; } int getQuantity() { return quantity; } double getCost() { return cost; } double getTotalCost() { return totalCost; } }; int main() { int itemNumber; int quantity; double cost; double totalCost; cout << "Enter the Item Number: "; cin >> itemNumber; while (itemNumber < 0) { cout << "Please enter a positive value for the Item Number: "; cin >> itemNumber;
  • 3. } cout << "Enter the Quantity of the item: "; cin >> quantity; while (quantity < 0) { cout << "Please enter a positive value for the Quantity of the item: "; cin >> quantity; } cout << "Enter the Cost of the item: "; cin >> cost; while (cost < 0) { cout << "Please enter a positive value for the Cost of the item: "; cin >> cost; } Inventory information(itemNumber, quantity, cost); totalCost = information.getTotalCost(); itemNumber = information.getItemNumber(); cost = information.getCost(); quantity = information.getQuantity(); cout << "The Item Number is: " << itemNumber << endl; cout << "The Quantity is: " << quantity << endl; cout << "The Cost is: " << cost << endl; cout << "The Total Cost is: " << totalCost << endl; return 0; } int _tmain(int argc, _TCHAR* argv[]) { return 0; } Solution #include "stdafx.h" #include
  • 4. using namespace std; class Inventory { private: int itemNumber; int quantity; double cost; double totalCost; public: Inventory() { itemNumber = 0; quantity = 0; cost = 0; totalCost = 0; } Inventory(int newItemNumber, int newQuantity, double newCost) { itemNumber = newItemNumber; quantity = newQuantity; cost = newCost; setTotalCost(quantity, cost); // this can be called as quantity and cost have now been initialized. } void setItemNumber(int) { itemNumber = itemNumber; } void setQuantity(int) { quantity = quantity; } void setCost(double) { cost = cost; }
  • 5. void setTotalCost(int, double) { totalCost = quantity * cost; } int getItemNumber() { return itemNumber; } int getQuantity() { return quantity; } double getCost() { return cost; } double getTotalCost() { return totalCost; } }; int main() { int itemNumber; int quantity; double cost; double totalCost; cout << "Enter the Item Number: "; cin >> itemNumber; while (itemNumber < 0) { cout << "Please enter a positive value for the Item Number: "; cin >> itemNumber; } cout << "Enter the Quantity of the item: "; cin >> quantity;
  • 6. while (quantity < 0) { cout << "Please enter a positive value for the Quantity of the item: "; cin >> quantity; } cout << "Enter the Cost of the item: "; cin >> cost; while (cost < 0) { cout << "Please enter a positive value for the Cost of the item: "; cin >> cost; } Inventory information(itemNumber, quantity, cost); totalCost = information.getTotalCost(); itemNumber = information.getItemNumber(); cost = information.getCost(); quantity = information.getQuantity(); cout << "The Item Number is: " << itemNumber << endl; cout << "The Quantity is: " << quantity << endl; cout << "The Cost is: " << cost << endl; cout << "The Total Cost is: " << totalCost << endl; return 0; } int _tmain(int argc, _TCHAR* argv[]) { return 0; }